From d2d88279289bcafbeca8a41934d514d58141376d Mon Sep 17 00:00:00 2001 From: regrain Date: Thu, 17 Mar 2005 14:16:59 +0000 Subject: [PATCH] * Builder/ : add possibility to build an installer on Windows using InnoSetup -- BeNours --- Builder/CMakeLists.txt | 40 +++++++++++++++ Builder/gdcm.iss | 50 ------------------ Builder/gdcm.iss.in | 78 +++++++++++++++++++++++++++++ CMakeLists.txt | 8 +++ gdcmPython/demo/PrintDicomDir.py.in | 4 ++ gdcmPython/demo/PrintFile.py.in | 3 ++ gdcmPython/demo/vtkGdcmReader.py.in | 6 ++- gdcmPython/demo/vtkGdcmWriter.py.in | 6 ++- 8 files changed, 143 insertions(+), 52 deletions(-) create mode 100644 Builder/CMakeLists.txt delete mode 100644 Builder/gdcm.iss create mode 100644 Builder/gdcm.iss.in diff --git a/Builder/CMakeLists.txt b/Builder/CMakeLists.txt new file mode 100644 index 00000000..30b6ba45 --- /dev/null +++ b/Builder/CMakeLists.txt @@ -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 index 53fd460f..00000000 --- a/Builder/gdcm.iss +++ /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 index 00000000..7c50b82f --- /dev/null +++ b/Builder/gdcm.iss.in @@ -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 + diff --git a/CMakeLists.txt b/CMakeLists.txt index 275610a9..6b0db95b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) + diff --git a/gdcmPython/demo/PrintDicomDir.py.in b/gdcmPython/demo/PrintDicomDir.py.in index 4b016d43..16f171e1 100644 --- a/gdcmPython/demo/PrintDicomDir.py.in +++ b/gdcmPython/demo/PrintDicomDir.py.in @@ -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]) diff --git a/gdcmPython/demo/PrintFile.py.in b/gdcmPython/demo/PrintFile.py.in index 007a3fa1..ee6bbfe5 100644 --- a/gdcmPython/demo/PrintFile.py.in +++ b/gdcmPython/demo/PrintFile.py.in @@ -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]) diff --git a/gdcmPython/demo/vtkGdcmReader.py.in b/gdcmPython/demo/vtkGdcmReader.py.in index aea5e5c8..0b0018c9 100644 --- a/gdcmPython/demo/vtkGdcmReader.py.in +++ b/gdcmPython/demo/vtkGdcmReader.py.in @@ -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) diff --git a/gdcmPython/demo/vtkGdcmWriter.py.in b/gdcmPython/demo/vtkGdcmWriter.py.in index c3f5809e..999035e8 100644 --- a/gdcmPython/demo/vtkGdcmWriter.py.in +++ b/gdcmPython/demo/vtkGdcmWriter.py.in @@ -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) -- 2.45.1