COOLPROP_TEST flag in CMake so you can add back Tests.cpp and CoolProp-Tests.cpp when building main

This commit is contained in:
Ian Bell
2015-04-23 14:35:27 -06:00
parent 0f449b3043
commit 1f91449303

View File

@@ -1037,10 +1037,20 @@ if(UNIX)
endif()
endif()
if (COOLPROP_MAIN_MODULE)
# Allow you to independently add back the testing CPP files
if(COOLPROP_TEST)
list(APPEND APP_SOURCES "${CMAKE_SOURCE_DIR}/src/Tests/Tests.cpp")
list(APPEND APP_SOURCES "${CMAKE_SOURCE_DIR}/src/Tests/CoolProp-Tests.cpp")
endif()
list(APPEND APP_SOURCES "${CMAKE_SOURCE_DIR}/src/main.cxx")
add_executable (Main ${APP_SOURCES})
add_dependencies (Main generate_headers)
if(COOLPROP_TEST)
set_target_properties (Main PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DENABLE_CATCH")
endif()
if(UNIX)
target_link_libraries (Main ${CMAKE_DL_LIBS})
endif()
@@ -1141,6 +1151,8 @@ if (COOLPROP_PROFILE)
endif()
if (COOLPROP_COVERAGE)
if(CMAKE_COMPILER_IS_GNUCXX)
# See also http://stackoverflow.com/a/16536401 (detailed guide on using gcov with cmake)