X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FCMakeLists.txt;h=aff9d67aaf65cbac9c5a86500a9987fec10f9562;hb=8845fe9fca6c1ed22eaaae4dd4561c0ba2f31a6b;hp=2c5cf7e025aa15eedfa4abc3e04ff226c8c5333e;hpb=eb46f178c8cd7efca6bc149bcd95c41a4a3704f2;p=gdcm.git diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index 2c5cf7e0..aff9d67a 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -1,45 +1,40 @@ -#For later : rewrite this things for more consistencies, such as a 'FOREACH' +# TODO: +# http://www.cmake.org/pipermail/cmake/2001-November/002491.html +# So that dll is copied to each subdir where needed -#TODO: -#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) -LINK_LIBRARIES(gdcm) -INCLUDE_DIRECTORIES( - ${GDCM_SOURCE_DIR}/src/ -) +IF(NOT CMAKE_HAVE_STDINT_H) + SET(GDCM_TEST_COMPILE_FLAGS "-DHAVE_NO_STDINT_H") +ENDIF(NOT CMAKE_HAVE_STDINT_H) -SET(PrintHeader_SOURCES - PrintHeader.cxx -) -ADD_EXECUTABLE(PrintHeader ${PrintHeader_SOURCES}) -SET(testWrite_SOURCES +SET(TEST_SOURCES + PrintHeader.cxx testWrite.cxx -) -ADD_EXECUTABLE(testWrite ${testWrite_SOURCES}) - -SET(testChangeEntete_SOURCES testChangeEntete.cxx -) -ADD_EXECUTABLE(testChangeEntete ${testChangeEntete_SOURCES}) - -SET(hashtest_SOURCES hashtest.cxx -) -ADD_EXECUTABLE(hashtest ${hashtest_SOURCES}) - -SET(bug1_SOURCES bug1.cxx -) -ADD_EXECUTABLE(bug1 ${bug1_SOURCES}) - -SET(pourFindTaggs_SOURCES pourFindTaggs.cxx + dcm2acr.cxx ) -ADD_EXECUTABLE(pourFindTaggs ${pourFindTaggs_SOURCES}) -SET(dcm2acr_SOURCES - dcm2acr.cxx +# include stuff +INCLUDE_DIRECTORIES( + ${GDCM_SOURCE_DIR}/src/ ) -ADD_EXECUTABLE(dcm2acr ${dcm2acr_SOURCES}) + +# 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(${name} gdcm) +ENDFOREACH(file ${TEST_SOURCES})