forked from apmccartney/catch-adapter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
59 lines (52 loc) · 2.14 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
cmake_minimum_required( VERSION 3.2 )
set( CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Supported configuration types" FORCE )
if( NOT is_subproject )
if( NOT ROOT_DIRECTORY )
set( ROOT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
endif()
if ( NOT PYTHON_EXECUTABLE )
find_package( PythonInterp )
if ( NOT PYTHONINTERP_FOUND )
message( FATAL_ERROR "Python interpreter installation was not found." )
endif()
endif()
execute_process( COMMAND ${PYTHON_EXECUTABLE} ./metaconfigure/signature.py ${CMAKE_BINARY_DIR}/signature
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE signature_failure )
file( READ "${CMAKE_BINARY_DIR}/signature.json" SIGNATURE )
endif()
project( catch-adapter LANGUAGES CXX )
get_directory_property( is_subproject PARENT_DIRECTORY )
include( CMakeDependentOption REQUIRED )
if ( NOT GIT_EXECUTABLE )
find_package( Git )
if ( NOT GIT_FOUND )
message( FATAL_ERROR "git installation was not found." )
endif()
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message( STATUS "" )
message( STATUS "-----------------------------------------------------------" )
message( STATUS "" )
message( STATUS "catch-adapter" )
message( STATUS "Git current branch: ${GIT_BRANCH}" )
message( STATUS "Git commit hash: ${GIT_HASH}" )
message( STATUS "" )
message( STATUS "-----------------------------------------------------------" )
add_library( catch-adapter INTERFACE )
target_include_directories( catch-adapter INTERFACE src/single_include )
target_sources( catch-adapter INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/src/single_include/catch.hpp" )
target_include_directories( catch-adapter INTERFACE
"${CMAKE_CURRENT_SOURCE_DIR}/src/single_include" )