summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-10-14 13:40:40 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-10-14 13:46:51 (GMT)
commit2e9b08af642254274a72b77c1e278538300dbb04 (patch)
tree7b896b756fce9c8c97811e5c174f375ffbb004a6 /src/tests
parenta5e759e229807d7d95a3dddcd8561208d80a2fde (diff)
Add option to build TNG testing binary.
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/CMakeLists.txt20
1 files changed, 11 insertions, 9 deletions
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)
contact: Jan Huwald // Impressum