commit ffa1bfd4775fa5be33ac4d3653080f35ce227d1e parent 863a9e3491480193b76526e56d9ca8f6fde551a7 Author: vaplv <vaplv@free.fr> Date: Sat, 19 Sep 2015 15:24:50 +0200 Add the NO_TEST build option Control the compilation of the test programs. Diffstat:
| M | cmake/CMakeLists.txt | | | 12 | ++++++++---- |
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -19,6 +19,8 @@ cmake_policy(SET CMP0011 NEW) enable_testing() option(BUILD_STATIC "Build library as static rather than shared" OFF) +option(NO_TEST "Do not compile the test pograms" OFF) + set(POLYGON_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) ################################################################################ @@ -72,10 +74,12 @@ rcmake_setup_devel(polygon Polygon ${VERSION} polygon_version.h) ################################################################################ # Define tests ################################################################################ -add_executable(test_polygon ${POLYGON_SOURCE_DIR}/test_polygon.c) -target_link_libraries(test_polygon polygon ${MATH_LIB}) -add_test(test_polygon test_polygon) -rcmake_set_test_runtime_dirs(test_polygon _runtime_dirs) +if(NOT NO_TEST) + add_executable(test_polygon ${POLYGON_SOURCE_DIR}/test_polygon.c) + target_link_libraries(test_polygon polygon ${MATH_LIB}) + add_test(test_polygon test_polygon) + rcmake_set_test_runtime_dirs(test_polygon _runtime_dirs) +endif(NOT NO_TEST) ################################################################################ # Install directories