Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow building against the system's Catch library.
- Loading branch information
1 parent
0b3361b
commit 3b1c3fb
Showing
3 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
find_package( Catch ) | ||
|
||
if ( CATCH_FOUND ) | ||
set( _catch_dir ${Catch_INCLUDE_DIRS} ) | ||
else () | ||
set( _catch_dir ${PTE_EXTERNAL_DIR}/Catch/single_include ) | ||
message( STATUS "Using Catch library from ${_catch_dir}" ) | ||
endif () | ||
|
||
add_library( Catch INTERFACE IMPORTED ) | ||
|
||
set_target_properties( | ||
Catch PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES ${PTE_EXTERNAL_DIR}/Catch/single_include | ||
INTERFACE_INCLUDE_DIRECTORIES ${_catch_dir} | ||
) | ||
|
||
unset( _catch_dir ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
include( FindPackageHandleStandardArgs ) | ||
|
||
find_path( CATCH_INCLUDE_DIR NAMES catch.hpp) | ||
set( Catch_INCLUDE_DIRS ${CATCH_INCLUDE_DIR} ) | ||
|
||
find_package_handle_standard_args( Catch DEFAULT_MSG CATCH_INCLUDE_DIR ) | ||
|
||
mark_as_advanced( CATCH_INCLUDE_DIR ) |