]> Creatis software - gdcm.git/commitdiff
* Builder/ : add possibility to build an installer on Windows using InnoSetup
authorregrain <regrain>
Thu, 17 Mar 2005 14:16:59 +0000 (14:16 +0000)
committerregrain <regrain>
Thu, 17 Mar 2005 14:16:59 +0000 (14:16 +0000)
   -- BeNours

Builder/CMakeLists.txt [new file with mode: 0644]
Builder/gdcm.iss [deleted file]
Builder/gdcm.iss.in [new file with mode: 0644]
CMakeLists.txt
gdcmPython/demo/PrintDicomDir.py.in
gdcmPython/demo/PrintFile.py.in
gdcmPython/demo/vtkGdcmReader.py.in
gdcmPython/demo/vtkGdcmWriter.py.in

diff --git a/Builder/CMakeLists.txt b/Builder/CMakeLists.txt
new file mode 100644 (file)
index 0000000..30b6ba4
--- /dev/null
@@ -0,0 +1,40 @@
+#-----------------------------------------------------------------------------
+# Search InnoSetup:
+FIND_FILE(INNOSETUP_EXECUTABLE ISCC.exe
+  "C:/Program Files/Inno Setup 5"
+  DOC "InnoSetup executable"
+)
+
+IF(EXISTS INNOSETUP_EXECUTABLE)
+  MESSAGE(ERROR "INNOSETUP_EXECUTABLE isn't set properly")
+ENDIF(EXISTS INNOSETUP_EXECUTABLE)
+IF(NOT GDCM_WRAP_PYTHON)
+  MESSAGE(ERROR "INNOSETUP_EXECUTABLE require GDCM_WRAP_PYTHON set to YES")
+ENDIF(NOT GDCM_WRAP_PYTHON)
+IF(NOT GDCM_VTK)
+  MESSAGE(ERROR "INNOSETUP_EXECUTABLE require GDCM_VTK set to YES")
+ENDIF(NOT GDCM_VTK)
+IF(NOT BUILD_EXAMPLES)
+  MESSAGE(ERROR "INNOSETUP_EXECUTABLE require BUILD_EXAMPLES set to YES")
+ENDIF(NOT BUILD_EXAMPLES)
+
+#-----------------------------------------------------------------------------
+# Set new variables to have Windows Paths
+STRING(REGEX REPLACE "/" "\\\\" INNO_SOURCE_DIR ${GDCM_SOURCE_DIR})
+STRING(REGEX REPLACE "/" "\\\\" INNO_BINARY_DIR ${GDCM_BINARY_DIR})
+STRING(REGEX REPLACE "/" "\\\\" INNO_DATA_DIR   ${GDCM_DATA_ROOT})
+
+#-----------------------------------------------------------------------------
+# Build the installer
+CONFIGURE_FILE(
+    ${GDCM_SOURCE_DIR}/Builder/gdcm.iss.in
+    ${GDCM_BINARY_DIR}/Builder/gdcm.iss
+)
+
+ADD_CUSTOM_TARGET(InstallerWin32
+  ALL
+  ${INNOSETUP_EXECUTABLE} ${GDCM_BINARY_DIR}/Builder/gdcm.iss
+)
+
+#-----------------------------------------------------------------------------
+
diff --git a/Builder/gdcm.iss b/Builder/gdcm.iss
deleted file mode 100644 (file)
index 53fd460..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-; Script generated by the Inno Setup Script Wizard.
-; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
-
-[Setup]
-AdminPrivilegesRequired=yes
-AppName=gdcm Environment
-AppVerName=gdcm 0.4
-AppPublisher=Creatis
-AppPublisherURL=http://www.creatis.insa-lyon.fr
-AppSupportURL=http://www.creatis.insa-lyon.fr
-AppUpdatesURL=http://www.creatis.insa-lyon.fr
-DefaultDirName=c:\Creatis\gdcm
-DisableDirPage=no
-DefaultGroupName=gdcm
-DisableProgramGroupPage=yes
-OutputDir=.\
-; uncomment the following line if you want your installation to run on NT 3.51 too.
-; MinVersion=4,3.51
-ShowComponentSizes=no
-DisableStartupPrompt=yes
-Uninstallable=no
-
-[Types]
-Name: "normal"; Description: "Normal installation";
-Name: "full"; Description: "Full installation"
-Name: "custom"; Description: "Selectable components"; Flags: iscustom
-
-[Components]
-Name: "core"; Description: "Libido core"; Types: normal full custom; Flags: fixed
-Name: "sources"; Description: "Soucres"; Types: custom full
-
-[Files]
-; Core
-Source: "..\lib\*.dll"; DestDir: "{app}\lib"; CopyMode: alwaysoverwrite; Components: core
-Source: "..\lib\*.lib"; DestDir: "{app}\lib"; CopyMode: alwaysoverwrite; Components: core
-Source: "..\Dicts\*.dic"; DestDir: "{app}\Dicts"; CopyMode: alwaysoverwrite; Components: core
-Source: "..\src\*.h"; DestDir: "{app}\include"; CopyMode: alwaysoverwrite; Components: core
-Source: "..\vtk\*.h"; DestDir: "{app}\include"; CopyMode: alwaysoverwrite; Components: core
-; Sources
-Source: "..\src\*.*"; DestDir: "{app}\src"; CopyMode: alwaysoverwrite; Components: sources
-Source: "..\src\jpeg\*.*"; DestDir: "{app}\src\jpeg"; CopyMode: alwaysoverwrite; Components: sources
-Source: "..\src\jpeg\libijg12\*.*"; DestDir: "{app}\src\jpeg\libijg12"; CopyMode: alwaysoverwrite; Components: sources
-Source: "..\src\jpeg\libijg8\*.*"; DestDir: "{app}\src\jpeg\libijg8"; CopyMode: alwaysoverwrite; Components: sources
-Source: "..\src\jpeg\ljpg\*.*"; DestDir: "{app}\src\jpeg\ljpg"; CopyMode: alwaysoverwrite; Components: sources
-Source: "..\vtk\*.*"; DestDir: "{app}\vtk"; CopyMode: alwaysoverwrite; Components: sources
-; Win compilers
-Source: "..\*.dsw"; DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: sources
-Source: "..\src\win32\*.dsp"; DestDir: "{app}\src\win32"; CopyMode: alwaysoverwrite; Components: sources
-Source: "..\vtk\win32\vtkgdcm.dsp"; DestDir: "{app}\vtk\win32"; CopyMode: alwaysoverwrite; Components: sources
-
diff --git a/Builder/gdcm.iss.in b/Builder/gdcm.iss.in
new file mode 100644 (file)
index 0000000..7c50b82
--- /dev/null
@@ -0,0 +1,78 @@
+; Script generated by the Inno Setup Script Wizard.
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
+
+[Setup]
+AdminPrivilegesRequired=yes
+AppName=${PROJECT_NAME} Library
+AppVerName=${PROJECT_NAME} ${GDCM_VERSION}
+AppPublisher=Creatis
+AppPublisherURL=http://www.creatis.insa-lyon.fr
+AppSupportURL=http://www.creatis.insa-lyon.fr
+AppUpdatesURL=http://www.creatis.insa-lyon.fr
+DefaultDirName=c:\Creatis\gdcm
+DisableDirPage=no
+DefaultGroupName=gdcm
+DisableProgramGroupPage=yes
+OutputDir=.\
+ShowComponentSizes=no
+DisableStartupPrompt=yes
+Uninstallable=yes
+LicenseFile=${INNO_SOURCE_DIR}\Doc\License.txt
+OutputBaseFilename=${PROJECT_NAME}${GDCM_MAJOR_VERSION}_${GDCM_MINOR_VERSION}_${GDCM_BUILD_VERSION}
+
+
+[Types]
+Name: "normal"; Description: "Normal installation";
+Name: "python"; Description: "Python installation";
+Name: "full";   Description: "Full installation"
+Name: "custom"; Description: "Selectable components"; Flags: iscustom
+
+[Components]
+Name: "core";    Description: "gdcm core";   Types: normal python full custom; Flags: fixed
+Name: "python";  Description: "gdcm python"; Types: python full custom;
+Name: "sources"; Description: "Sources";     Types: custom full
+
+[Files]
+; Core
+Source: "${INNO_BINARY_DIR}\bin\Release\ex*.exe";    DestDir: "{app}\bin";                     CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_BINARY_DIR}\bin\Release\Print*.exe"; DestDir: "{app}\bin";                     CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_BINARY_DIR}\bin\Release\*.dll";      DestDir: "{app}\bin";                     CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_BINARY_DIR}\bin\Release\*.lib";      DestDir: "{app}\lib\gdcm";                CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_SOURCE_DIR}\Dicts\*.dic";            DestDir: "{app}\Dicts";                   CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_SOURCE_DIR}\src\*.h";                DestDir: "{app}\include\gdcm";            CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_SOURCE_DIR}\vtk\*.h";                DestDir: "{app}\include\gdcm";            CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_DATA_DIR}\test.acr";                 DestDir: "{app}\data";                    CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_DATA_DIR}\DICOMDIR";                 DestDir: "{app}\data";                    CopyMode: alwaysoverwrite; Components: core
+
+; Python
+Source: "${INNO_BINARY_DIR}\gdcmPython\*.py";        DestDir: "{app}\gdcmPython";              CopyMode: alwaysoverwrite; Components: python
+Source: "${INNO_BINARY_DIR}\gdcmPython\*.pth";       DestDir: "{app}\gdcmPython";              CopyMode: alwaysoverwrite; Components: python
+Source: "${INNO_BINARY_DIR}\gdcmPython\demo\*.py";   DestDir: "{app}\gdcmPython\demo";         CopyMode: alwaysoverwrite; Components: python
+Source: "${INNO_DATA_DIR}\test.acr";                 DestDir: "{app}\gdcmPython\demo";         CopyMode: alwaysoverwrite; Components: python
+Source: "${INNO_DATA_DIR}\DICOMDIR";                 DestDir: "{app}\gdcmPython\demo";         CopyMode: alwaysoverwrite; Components: python
+
+; Sources
+Source: "${INNO_SOURCE_DIR}\src\*.*";                DestDir: "{app}\Sources\src";             CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\src\gdcmjpeg\*.*";       DestDir: "{app}\Sources\src\gdcmjpeg";    CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\src\gdcmjpeg\8\*.*";     DestDir: "{app}\Sources\src\gdcmjpeg\8";  CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\src\gdcmjpeg\12\*.*";    DestDir: "{app}\Sources\src\gdcmjpeg\12"; CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\src\gdcmjpeg\16\*.*";    DestDir: "{app}\Sources\src\gdcmjpeg\16"; CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\vtk\*.*";                DestDir: "{app}\Sources\vtk";             CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\gdcmPython\*.*";         DestDir: "{app}\Sources\gdcmPython";      CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\gdcmPython\demo\*.*";    DestDir: "{app}\Sources\gdcmPython\demo"; CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\Doc\*.*";                DestDir: "{app}\Sources\Doc";             CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\Dicts\*.*";              DestDir: "{app}\Sources\Dicts";           CopyMode: alwaysoverwrite; Components: sources
+Source: "${INNO_SOURCE_DIR}\CMake*.*";               DestDir: "{app}\Sources";                 CopyMode: alwaysoverwrite; Components: sources
+
+; CMake
+Source: "${INNO_SOURCE_DIR}\*.CMake";                DestDir: "{app}";                         CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_BINARY_DIR}\*.CMake";                DestDir: "{app}";                         CopyMode: alwaysoverwrite; Components: core
+
+; Others
+Source: "${INNO_SOURCE_DIR}\Doc\License.txt";        DestDir: "{app}";                         CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_SOURCE_DIR}\AUTHORS";                DestDir: "{app}";                         CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_SOURCE_DIR}\DEVELOPPER";             DestDir: "{app}";                         CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_SOURCE_DIR}\INSTALL";                DestDir: "{app}";                         CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_SOURCE_DIR}\NEWS";                   DestDir: "{app}";                         CopyMode: alwaysoverwrite; Components: core
+Source: "${INNO_SOURCE_DIR}\README";                 DestDir: "{app}";                         CopyMode: alwaysoverwrite; Components: core
+
index 275610a9c9703601ec6f32869b1dff7ccd2540de..6b0db95b35b2a68c122a77566d644b867471143b 100644 (file)
@@ -228,3 +228,11 @@ IF(GDCM_DOCUMENTATION)
   ENDIF(DOXYGEN)
 ENDIF(GDCM_DOCUMENTATION)
 
+#-----------------------------------------------------------------------------
+IF(WIN32)
+  OPTION(GDCM_INSTALLER "Build the install setup using InnoSetup." OFF)
+  IF(GDCM_INSTALLER)
+    SUBDIRS(Builder)
+  ENDIF(GDCM_INSTALLER)
+ENDIF(WIN32)
+
index 4b016d43037842c6537d315290154d69e22bfd7d..16f171e1783978a816a0ad036124556c145108e7 100644 (file)
@@ -1,3 +1,5 @@
+import sys
+import os.path
 from gdcmConfigDemo import *
 from gdcmPython.core import *
 
@@ -15,6 +17,8 @@ try:
    fileName = sys.argv[1]
 except IndexError:
    fileName = os.path.join(GDCM_DATA_ROOT, "DICOMDIR")
+   if( not os.path.isfile(fileName) ):
+      fileName=os.path.join(os.path.split(sys.argv[0])[0],"DICOMDIR")
 
 try:
    printLevel = int(sys.argv[2])
index 007a3fa1bfc8422f39044e58c2c163d6649c9f78..ee6bbfe502c22095a5dc48cd1a642118f15f186d 100644 (file)
@@ -1,4 +1,5 @@
 import sys
+import os.path
 from gdcmConfigDemo import *
 from gdcmPython.core import *
 
@@ -16,6 +17,8 @@ try:
    fileName = sys.argv[1]
 except IndexError:
    fileName = os.path.join(GDCM_DATA_ROOT, "test.acr")
+   if( not os.path.isfile(fileName) ):
+      fileName=os.path.join(os.path.split(sys.argv[0])[0],"test.acr")
 
 try:
    printLevel = int(sys.argv[2])
index aea5e5c879fda132c0fb83fa2faa3a4b2e78ef93..0b0018c9295ff048bf086254e0321da6a60c6106 100644 (file)
@@ -1,3 +1,5 @@
+import sys
+import os.path
 from gdcmConfigDemo import *
 from gdcmPython.vtk import *
 from vtkpython import *
@@ -16,7 +18,9 @@ try:
    fileName = sys.argv[1]
 except IndexError:
    fileName = os.path.join(GDCM_DATA_ROOT, "test.acr")
-   
+   if( not os.path.isfile(fileName) ):
+      fileName=os.path.join(os.path.split(sys.argv[0])[0],"test.acr")
+
 if( not os.path.isfile(fileName) ):
    PrintUse()
    sys.exit(1)
index c3f5809ee53b99702f32b29fd9acc0390cb33dee..999035e8d024a71f9ca882c6e2ea3122d93fce95 100644 (file)
@@ -1,3 +1,5 @@
+import sys
+import os.path
 from gdcmConfigDemo import *
 from gdcmPython.vtk import *
 from vtkpython import *
@@ -16,7 +18,9 @@ try:
    fileName = sys.argv[1]
 except IndexError:
    fileName = os.path.join(GDCM_DATA_ROOT, "test.acr")
-   
+   if( not os.path.isfile(fileName) ):
+      fileName=os.path.join(os.path.split(sys.argv[0])[0],"test.acr")
+
 if( not os.path.isfile(fileName) ):
    PrintUse()
    sys.exit(1)