From: malaterre Date: Fri, 14 Nov 2003 15:20:15 +0000 (+0000) Subject: *FIX: Forgot about missing flags for SunOs + old gcc X-Git-Tag: Version0.3.1~28 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=e9ed8c97435c5edc950177ff1a0e43b6ce4713b8;p=gdcm.git *FIX: Forgot about missing flags for SunOs + old gcc *FIX: Lib were not link properly --- 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})