diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | src/tests/CMakeLists.txt | 20 |
2 files changed, 12 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 02cb2bb..4abb45f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ include_directories(${CMAKE_SOURCE_DIR}/include) option(TNG_BUILD_FORTRAN "Build Fortran compatible library and examples for testing" OFF) option(TNG_BUILD_EXAMPLES "Build examples showing usage of the TNG API" ON) +option(TNG_BUILD_TEST "Build tng testing binary." ON) option(TNG_BUILD_COMPRESSION_TESTS "Build tests of the TNG compression library" OFF) option(TNG_USE_OPENMP "Try to use the OpenMP library (if available)" OFF) diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 13e7d88..edacbb2 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -13,17 +13,19 @@ set(EXAMPLE_FILES_DIR ${CMAKE_BINARY_DIR}/example_files/ CACHE STRING "Directory configure_file(${TNG_IO_SOURCE_DIR}/include/tng_io_testing.h.in ${CMAKE_BINARY_DIR}/generated/tng_io_testing.h) include_directories(${CMAKE_BINARY_DIR}/generated/) -add_executable(tng_testing tng_io_testing.c) -target_link_libraries(tng_testing tng_io) -if(UNIX) -target_link_libraries(tng_testing m) -endif() +if(TNG_BUILD_TEST) + add_executable(tng_testing tng_io_testing.c) + target_link_libraries(tng_testing tng_io) + if(UNIX) + target_link_libraries(tng_testing m) + endif() -if(HAVE_INTTYPES_H) - set_target_properties(tng_testing PROPERTIES COMPILE_DEFINITIONS USE_STD_INTTYPES_H=1) -endif() + if(HAVE_INTTYPES_H) + set_target_properties(tng_testing PROPERTIES COMPILE_DEFINITIONS USE_STD_INTTYPES_H=1) + endif() -set_property(TARGET tng_testing PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests) + set_property(TARGET tng_testing PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests) +endif() if(TNG_BUILD_EXAMPLES) if(OPENMP_FOUND) |