]> Creatis software - gdcm.git/blob - Testing/CMakeLists.txt
aff9d67aaf65cbac9c5a86500a9987fec10f9562
[gdcm.git] / Testing / CMakeLists.txt
1 # TODO:
2 # http://www.cmake.org/pipermail/cmake/2001-November/002491.html
3 # So that dll is copied to each subdir where needed
4
5 INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
6 CHECK_INCLUDE_FILE("stdint.h"    CMAKE_HAVE_STDINT_H)
7
8 IF(NOT CMAKE_HAVE_STDINT_H)
9   SET(GDCM_TEST_COMPILE_FLAGS "-DHAVE_NO_STDINT_H")
10 ENDIF(NOT CMAKE_HAVE_STDINT_H)
11
12
13 SET(TEST_SOURCES
14   PrintHeader.cxx
15   testWrite.cxx
16   testChangeEntete.cxx
17   hashtest.cxx
18   bug1.cxx
19   pourFindTaggs.cxx
20   dcm2acr.cxx
21 )
22
23 # include stuff
24 INCLUDE_DIRECTORIES(
25   ${GDCM_SOURCE_DIR}/src/
26 )
27
28 # Loop over files and create executables
29 FOREACH(file ${TEST_SOURCES})
30   #Doh ! I need to specify each time the compile flags !
31   IF(GDCM_TEST_COMPILE_FLAGS)
32   SET_SOURCE_FILES_PROPERTIES(${file}
33     PROPERTIES
34     COMPILE_FLAGS ${GDCM_TEST_COMPILE_FLAGS}
35   )
36   ENDIF(GDCM_TEST_COMPILE_FLAGS)
37   GET_FILENAME_COMPONENT(name ${file} NAME_WE)
38   ADD_EXECUTABLE(${name} ${file})
39   TARGET_LINK_LIBRARIES(${name} gdcm)
40 ENDFOREACH(file ${TEST_SOURCES})