]> Creatis software - gdcm.git/blob - Builder/CMakeLists.txt
Converts a Raw file into an old style Bruker Dicom File, InTag compliant
[gdcm.git] / Builder / CMakeLists.txt
1
2
3 IF(WIN32)
4
5 IF(NOT GDCM_WRAP_PYTHON)
6   MESSAGE(ERROR " INNOSETUP_EXECUTABLE require GDCM_WRAP_PYTHON set to YES")
7 ENDIF(NOT GDCM_WRAP_PYTHON)
8 IF(NOT GDCM_VTK)
9   MESSAGE(ERROR " INNOSETUP_EXECUTABLE require GDCM_VTK set to YES")
10 ENDIF(NOT GDCM_VTK)
11 IF(NOT BUILD_EXAMPLES)
12   MESSAGE(ERROR " INNOSETUP_EXECUTABLE require BUILD_EXAMPLES set to YES")
13 ENDIF(NOT BUILD_EXAMPLES)
14
15   # Search InnoSetup:
16   FIND_FILE(INNOSETUP_EXECUTABLE ISCC.exe
17     "C:/Program Files/Inno Setup 5"
18     DOC "InnoSetup executable"
19   )
20
21   IF(EXISTS INNOSETUP_EXECUTABLE)
22     MESSAGE(ERROR "INNOSETUP_EXECUTABLE isn't set properly")
23   ENDIF(EXISTS INNOSETUP_EXECUTABLE)
24
25   #-----------------------------------------------------------------------------
26   # Set new variables to have Windows Paths
27   STRING(REGEX REPLACE "/" "\\\\" INNO_SOURCE_DIR ${GDCM_SOURCE_DIR})
28   STRING(REGEX REPLACE "/" "\\\\" INNO_BINARY_DIR ${GDCM_BINARY_DIR})
29   STRING(REGEX REPLACE "/" "\\\\" INNO_DATA_DIR   ${GDCM_DATA_ROOT})
30
31   #-----------------------------------------------------------------------------
32   # Build the installer
33   CONFIGURE_FILE(
34       ${GDCM_SOURCE_DIR}/Builder/gdcm.iss.in
35       ${GDCM_BINARY_DIR}/Builder/gdcm.iss
36   )
37
38   ADD_CUSTOM_TARGET(InstallerWin32
39     ALL
40     ${INNOSETUP_EXECUTABLE} ${GDCM_BINARY_DIR}/Builder/gdcm.iss
41   )
42   #-----------------------------------------------------------------------------
43 ENDIF(WIN32)
44
45 IF(UNIX)
46   #-----------------------------------------------------------------------------
47   # Build the installer
48   CONFIGURE_FILE(
49       ${GDCM_SOURCE_DIR}/Builder/gdcm.spec.in
50       ${GDCM_BINARY_DIR}/Builder/gdcm.spec
51   )
52
53   STRING(REGEX REPLACE ".*/" "" SPEC_SOURCE_DIR ${GDCM_SOURCE_DIR})
54   EXEC_PROGRAM("date +%Y%m%d" OUTPUT_VARIABLE GDCM_DATE)
55
56   EXEC_PROGRAM("tar -zcvf ${GDCM_BINARY_DIR}/Builder/gdcm.tar.gz ${SPEC_SOURCE_DIR}" ${GDCM_SOURCE_DIR}/..)
57   #-----------------------------------------------------------------------------
58 ENDIF(UNIX)