X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FCMakeLists.txt;h=aff9d67aaf65cbac9c5a86500a9987fec10f9562;hb=f8273351d460d9f04206e149febc8d1cc7af3fde;hp=c273c1d508d4be997e21dce06a6e1c37d55e85a3;hpb=7b90a94638699fec1143d1928f6a6b6f3c769d54;p=gdcm.git diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index c273c1d5..aff9d67a 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -1,41 +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 -LINK_LIBRARIES(gdcm) -INCLUDE_DIRECTORIES( - ${GDCM_SOURCE_DIR}/src/ -) +INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +CHECK_INCLUDE_FILE("stdint.h" CMAKE_HAVE_STDINT_H) -SET(PrintHeader_SOURCES - PrintHeader.cxx -) -ADD_EXECUTABLE(PrintHeader ${PrintHeader_SOURCES}) +IF(NOT CMAKE_HAVE_STDINT_H) + SET(GDCM_TEST_COMPILE_FLAGS "-DHAVE_NO_STDINT_H") +ENDIF(NOT CMAKE_HAVE_STDINT_H) -SET(testWrite_SOURCES - testWrite.cxx -) -ADD_EXECUTABLE(testWrite ${testWrite_SOURCES}) -SET(testChangeEntete_SOURCES +SET(TEST_SOURCES + PrintHeader.cxx + testWrite.cxx 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})