]> Creatis software - gdcm.git/blob - Testing/CMakeLists.txt
ENH: Adding automatic testing
[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 SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
6
7 SET(GDCM_TESTS ${CXX_TEST_PATH}/gdcmTests)
8
9 INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
10 CHECK_INCLUDE_FILE("stdint.h"    CMAKE_HAVE_STDINT_H)
11
12 IF(NOT CMAKE_HAVE_STDINT_H)
13   SET(GDCM_TEST_COMPILE_FLAGS "-DHAVE_NO_STDINT_H")
14 ENDIF(NOT CMAKE_HAVE_STDINT_H)
15
16
17 SET(TEST_SOURCES
18   PrintHeader.cxx
19   testWrite.cxx
20   testChangeEntete.cxx
21   hashtest.cxx
22   bug1.cxx
23   pourFindTaggs.cxx
24   dcm2acr.cxx
25   PrintDicomDir.cxx
26   makeDicomDir.cxx
27   testDicomDir.cxx
28 )
29
30 # include stuff
31 INCLUDE_DIRECTORIES(
32   ${GDCM_SOURCE_DIR}/src/
33 )
34
35 # Loop over files and create executables
36 FOREACH(file ${TEST_SOURCES})
37   #Doh ! I need to specify each time the compile flags !
38   IF(GDCM_TEST_COMPILE_FLAGS)
39   SET_SOURCE_FILES_PROPERTIES(${file}
40     PROPERTIES
41     COMPILE_FLAGS ${GDCM_TEST_COMPILE_FLAGS}
42   )
43   ENDIF(GDCM_TEST_COMPILE_FLAGS)
44   GET_FILENAME_COMPONENT(name ${file} NAME_WE)
45   ADD_TEST(${name} ${GDCM_TESTS} ${name})
46 ENDFOREACH(file ${TEST_SOURCES})
47
48
49 ADD_EXECUTABLE(gdcmTests gdcmTests.cxx ${TEST_SOURCES})
50 TARGET_LINK_LIBRARIES(gdcmTests gdcm)
51
52