Fix ctest configuration
This commit is contained in:
parent
664a0bb2bb
commit
73f41aac05
2 changed files with 2 additions and 2 deletions
|
|
@ -19,7 +19,7 @@ option(CPPAST_BUILD_EXAMPLE "whether or not to build the examples" OFF)
|
||||||
option(CPPAST_BUILD_TOOL "whether or not to build the tool" OFF)
|
option(CPPAST_BUILD_TOOL "whether or not to build the tool" OFF)
|
||||||
option(BUILD_TESTING "build test" OFF) # The ctest variable for building tests
|
option(BUILD_TESTING "build test" OFF) # The ctest variable for building tests
|
||||||
|
|
||||||
if((${CPPAST_BUILD_TEST} OR ${BUILD_TESTING}) OR (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR))
|
if(${CPPAST_BUILD_TEST} OR (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR))
|
||||||
set(build_test ON)
|
set(build_test ON)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # for the self integration test
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # for the self integration test
|
||||||
else()
|
else()
|
||||||
|
|
@ -49,6 +49,7 @@ endif()
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
if(${build_test})
|
if(${build_test})
|
||||||
|
enable_testing()
|
||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif()
|
endif()
|
||||||
if(${build_example})
|
if(${build_example})
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ target_compile_definitions(cppast_test PUBLIC CPPAST_INTEGRATION_FILE="${CMAKE_C
|
||||||
CPPAST_COMPILE_COMMANDS="${CMAKE_BINARY_DIR}")
|
CPPAST_COMPILE_COMMANDS="${CMAKE_BINARY_DIR}")
|
||||||
set_target_properties(cppast_test PROPERTIES CXX_STANDARD 11)
|
set_target_properties(cppast_test PROPERTIES CXX_STANDARD 11)
|
||||||
|
|
||||||
enable_testing()
|
|
||||||
add_test(NAME test COMMAND cppast_test)
|
add_test(NAME test COMMAND cppast_test)
|
||||||
|
|
||||||
if(CPPAST_TEST_GCOV AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
|
if(CPPAST_TEST_GCOV AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue