File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed
Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -8,20 +8,24 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
88 set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR} /cmake;${CMAKE_MODULE_PATH} " )
99 find_package (nlohmann_json REQUIRED)
1010 set (CMAKE_CXX_STANDARD 17)
11- find_package (Catch2)
1211endif ()
1312
1413add_executable (aluminumNew aluminumNew.cpp)
1514target_link_libraries (aluminumNew OpenPFC nlohmann_json::nlohmann_json)
1615
17- if (TARGET Catch2::Catch2WithMain)
18- add_executable (aluminumTest aluminumTest.cpp)
19- target_link_libraries (aluminumTest OpenPFC nlohmann_json::nlohmann_json Catch2::Catch2WithMain)
20- list (APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR} /extras)
21- include (CTest)
22- catch_discover_tests(aluminumTest)
23- else ()
24- message (STATUS "Aluminum: Catch2 not found, not building tests" )
16+ option (ALUMINUM_ENABLE_TESTS "Enable building Aluminum tests" ON )
17+
18+ if (ALUMINUM_ENABLE_TESTS)
19+ find_package (Catch2 REQUIRED)
20+ if (TARGET Catch2::Catch2WithMain)
21+ add_executable (aluminumTest aluminumTest.cpp)
22+ target_link_libraries (aluminumTest OpenPFC nlohmann_json::nlohmann_json Catch2::Catch2WithMain)
23+ include (CTest)
24+ include (Catch)
25+ catch_discover_tests(aluminumTest)
26+ else ()
27+ message (WARNING "Aluminum: Catch2 not found, not building tests" )
28+ endif ()
2529endif ()
2630
2731install (TARGETS aluminumNew DESTINATION bin)
You can’t perform that action at this time.
0 commit comments