X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FCMakeLists.txt;h=aff9d67aaf65cbac9c5a86500a9987fec10f9562;hb=e9ed8c97435c5edc950177ff1a0e43b6ce4713b8;hp=0d1d911ec323d7d3b0546899f2fe8b4fad071e7a;hpb=3a55ca07d9cb9808cbec702f8f505616a6753009;p=gdcm.git diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index 0d1d911e..aff9d67a 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -2,6 +2,14 @@ # http://www.cmake.org/pipermail/cmake/2001-November/002491.html # So that dll is copied to each subdir where needed +INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +CHECK_INCLUDE_FILE("stdint.h" CMAKE_HAVE_STDINT_H) + +IF(NOT CMAKE_HAVE_STDINT_H) + SET(GDCM_TEST_COMPILE_FLAGS "-DHAVE_NO_STDINT_H") +ENDIF(NOT CMAKE_HAVE_STDINT_H) + + SET(TEST_SOURCES PrintHeader.cxx testWrite.cxx @@ -19,7 +27,14 @@ INCLUDE_DIRECTORIES( # Loop over files and create executables FOREACH(file ${TEST_SOURCES}) + #Doh ! I need to specify each time the compile flags ! + IF(GDCM_TEST_COMPILE_FLAGS) + SET_SOURCE_FILES_PROPERTIES(${file} + PROPERTIES + COMPILE_FLAGS ${GDCM_TEST_COMPILE_FLAGS} + ) + ENDIF(GDCM_TEST_COMPILE_FLAGS) GET_FILENAME_COMPONENT(name ${file} NAME_WE) ADD_EXECUTABLE(${name} ${file}) - TARGET_LINK_LIBRARIES(gdcm) + TARGET_LINK_LIBRARIES(${name} gdcm) ENDFOREACH(file ${TEST_SOURCES})