Skip to content

Commit 240dbb9

Browse files
FreddieAkeroydFreddie Akeroyd
authored and
Freddie Akeroyd
committed
Fixes for windows installer and component packages
refs nexusformat#221 git-svn-id: https://svn.nexusformat.org/definitions/trunk@1075 e2afd93b-eb5f-4fc1-b239-527b97798288
1 parent f039a28 commit 240dbb9

File tree

7 files changed

+82
-64
lines changed

7 files changed

+82
-64
lines changed

CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,15 @@ endforeach()
6868

6969
# CMAKE_INSTALL_PREFIX is only used if CMAKE_SET_DESTDIR is true,
7070
# so it will not be used in zip and tgz packages
71-
set(CMAKE_INSTALL_PREFIX "/usr/share/nexus/")
71+
if(UNIX)
72+
set(CMAKE_INSTALL_PREFIX "/usr/share/nexus/")
73+
endif()
7274
set(NEXUS_DEFINITIONS "definitions")
7375
set(NEXUS_MANUAL "manual")
7476

75-
find_package(LATEX)
7677
find_package(PythonInterp)
78+
find_package(LATEX)
79+
find_program(DBLATEX dblatex)
7780

7881
if (WIN32)
7982
find_program(XSLTPROC xsltproc PATHS "${CMAKE_SOURCE_DIR}/utils/win32")
@@ -82,6 +85,10 @@ else(WIN32)
8285
endif()
8386
find_program(SVNVERSION svnversion)
8487

88+
#configure_file("${PROJECT_SOURCE_DIR}/utils/win32/dblatex_cygwin.bat.in"
89+
# "${PROJECT_BINARY_DIRECTORY}/utils/win32/dblatex_cygwin.bat"
90+
# @ONLY)
91+
8592
# Recurse into the subdirectories.
8693
#add_subdirectory (tutorial)
8794
add_subdirectory (base_classes)
@@ -99,6 +106,8 @@ foreach(F ${XSD_FILES})
99106
endforeach()
100107
INSTALL(FILES LGPL DESTINATION ${NEXUS_DEFINITIONS} COMPONENT definitions)
101108

109+
file(TO_NATIVE_PATH ${CMAKE_SOURCE_DIR} CMAKE_SOURCE_DIR_NATIVE)
110+
string(REPLACE "\\" "\\\\" CMAKE_SOURCE_DIR_NATIVE_D ${CMAKE_SOURCE_DIR_NATIVE})
102111
#
103112
# set CPack packaging options
104113
#

CPackOptions.cmake.in

Lines changed: 68 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -31,119 +31,126 @@
3131

3232
include(CPackComponent)
3333

34-
set(CPACK_COMPONENTS_ALL manual;definitions)
35-
34+
#set(CPACK_ALL_INSTALL_TYPES Full)
35+
#set(CPACK_COMPONENTS_ALL manual definitions) # default is all components mentioned
3636

3737
if (NOT WIN32)
38-
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove this line when CMake >= 2.8.4 is required
38+
if (${CMAKE_VERSION} VERSION_LESS 2.8.4)
39+
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove this line when CMake >= 2.8.4 is required
40+
endif()
3941
endif()
4042

4143
set (CPACK_PACKAGE_NAME "NeXusDefinitions")
44+
4245
if (${CPACK_GENERATOR} STREQUAL "DEB")
46+
set(CPACK_DEB_COMPONENT_INSTALL ON)
4347
set(CPACK_INSTALL_PREFIX "/usr/share/nexus")
4448
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/share/nexus")
4549
set(CPACK_PACKAGE_NAME "nexus") # used for components
4650
# set(CPACK_DEBIAN_PACKAGE_DEBUG TRUE)
51+
set (CPACK_DEBIAN_PACKAGE_NAME "nexus")
52+
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all")
53+
set (CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
54+
set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://www.nexusformat.org/")
4755
endif()
4856
if (${CPACK_GENERATOR} STREQUAL "RPM")
4957
set(CPACK_INSTALL_PREFIX "/usr/share/nexus")
5058
set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/share/nexus")
5159
# set(CPACK_RPM_PACKAGE_PREFIX "/usr/share/nexus")
5260
# set(CPACK_RPM_PACKAGE_DEBUG TRUE)
61+
set (CPACK_RPM_PACKAGE_NAME "nexus")
62+
set (CPACK_RPM_PACKAGE_ARCHITECTURE "noarch")
63+
set (CPACK_RPM_PACKAGE_RELEASE "1")
64+
# set (CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
65+
# set (CPACK_RPM_PACKAGE_PROVIDES "")
66+
set(CPACK_RPM_COMPONENT_INSTALL ON)
67+
set(CPACK_RPM_PACKAGE_LICENSE "LGPL")
68+
set(CPACK_RPM_PACKAGE_URL "http://www.nexusformat.org/")
69+
# set(CPACK_RPM_CHANGELOG_FILE "")
5370
endif()
5471
if (${CPACK_GENERATOR} STREQUAL "TGZ")
55-
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON)
56-
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY ON)
57-
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
72+
set(CPACK_TGZ_COMPONENT_INSTALL ON)
73+
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON)
74+
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY ON)
75+
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
5876
endif()
5977
if (${CPACK_GENERATOR} STREQUAL "ZIP")
60-
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON)
61-
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY ON)
62-
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
78+
set(CPACK_ZIP_COMPONENT_INSTALL ON)
79+
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY ON)
80+
set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY ON)
81+
set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
6382
endif()
6483

65-
set(CPACK_TGZ_COMPONENT_INSTALL ON)
66-
set(CPACK_ZIP_COMPONENT_INSTALL ON)
67-
set(CPACK_DEB_COMPONENT_INSTALL ON)
68-
6984
set(CPACK_PACKAGE_CONTACT "NeXus Developers <[email protected]>")
7085

71-
set (CPACK_RPM_PACKAGE_NAME "nexus")
72-
set (CPACK_RPM_PACKAGE_ARCHITECTURE "noarch")
73-
set (CPACK_RPM_PACKAGE_RELEASE "1")
74-
#set (CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
75-
#set (CPACK_RPM_PACKAGE_PROVIDES "")
76-
set(CPACK_RPM_COMPONENT_INSTALL ON)
77-
set(CPACK_RPM_PACKAGE_LICENSE "LGPL")
78-
set(CPACK_RPM_PACKAGE_URL "http://www.nexusformat.org/")
79-
#set(CPACK_RPM_CHANGELOG_FILE "")
80-
81-
## may need some of these for Win32/NSIS
82-
#CPACK_PACKAGING_INSTALL_PREFIX
83-
#CPACK_PACKAGE_INSTALL_DIRECTORY "definitions ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH}"
84-
85-
set (CPACK_DEBIAN_PACKAGE_NAME "nexus")
86-
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "all")
87-
set (CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
88-
set (CPACK_DEBIAN_PACKAGE_HOMEPAGE"http://www.nexusformat.org/")
89-
9086
set (CPACK_PACKAGE_VENDOR "NeXus International Advisory Committee")
9187
set (CPACK_PACKAGE_VERSION_MAJOR "3")
9288
set (CPACK_PACKAGE_VERSION_MINOR "1")
9389
set (CPACK_PACKAGE_VERSION_PATCH "0")
9490
set (CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
91+
set (CPACK_RESOURCE_FILE_LICENSE "@CMAKE_SOURCE_DIR@/LGPL")
92+
set (CPACK_RESOURCE_FILE_README "@CMAKE_SOURCE_DIR@/package/README.txt")
93+
set (CPACK_RESOURCE_FILE_WELCOME "@CMAKE_SOURCE_DIR@/package/WELCOME.txt")
94+
set (CPACK_PACKAGE_ICON "@CMAKE_SOURCE_DIR@/package/nexus.ico")
9595
set (CPACK_PACKAGE_DESCRIPTION_FILE "@CMAKE_SOURCE_DIR@/package/description.txt")
9696
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "NeXus NXDL class definitions and manual, http://www.nexusformat.org/")
9797
set (CPACK_PACKAGE_FILE_NAME "nexus-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
98-
set (CPACK_PACKAGE_INSTALL_DIRECTORY "NeXus Data Format")
99-
set (CPACK_RESOURCE_FILE_LICENSE "@CMAKE_SOURCE_DIR@/COPYING")
100-
set (CPACK_RESOURCE_FILE_README "@CMAKE_SOURCE_DIR/package/README.txt")
101-
set (CPACK_RESOURCE_FILE_WELCOME "@CMAKE_SOURCE_DIR@/package/WELCOME.txt")
102-
#set (CPACK_MONOLITHIC_INSTALL)
98+
set (CPACK_SOURCE_PACKAGE_FILE_NAME "nexus-source-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
99+
set (CPACK_PACKAGE_INSTALL_DIRECTORY "NeXus Definitions")
103100

104-
set(CPACK_BINARY_ZIP OFF)
105101
#set(CPACK_SOURCE_IGNORE_FILES
106102
# "nexus_spec.in;~$;/\.svn/;/\.cvsignore/;/CMakeFiles/;/nbproject/;autogen.sh;cmake_install.cmake;Makefile;${CPACK_SOURCE_IGNORE_FILES}")
107103

108104
# we do not have any absolute paths, so do not need DESTDIR
109105
SET(CPACK_SET_DESTDIR "OFF")
110106
SET(CPACK_PACKAGE_RELOCATABLE TRUE)
111107

112-
if(WIN32)
113-
set(CPACK_BINARY_NSIS OFF)
114-
set(CPACK_NSIS_PACKAGE_NAME "NeXus Definitions ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH}")
115-
# set(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
116-
# set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\MyExecutable.exe")
117-
set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} NeXus")
118-
set(CPACK_NSIS_HELP_LINK "http://www.nexusformat.org/")
119-
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.nexusformat.org/")
120-
set(CPACK_NSIS_CONTACT "${CPACK_PACKAGE_CONTACT}")
121-
set(CPACK_NSIS_MODIFY_PATH ON)
122-
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Name of the registry key for the installer
108+
if (${CPACK_GENERATOR} STREQUAL "NSIS")
109+
### NSIS component installs seem to trigger download option at the moment, so set monolithic install and a full package name until we can figure out why
110+
set(CPACK_MONOLITHIC_INSTALL ON)
111+
set(CPACK_PACKAGE_FILE_NAME "nexus-definitions-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
112+
set(CPACK_NSIS_PACKAGE_NAME "NeXus Definitions ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
113+
set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} NeXus")
114+
set(CPACK_NSIS_HELP_LINK "http://www.nexusformat.org/")
115+
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.nexusformat.org/")
116+
set(CPACK_NSIS_CONTACT "${CPACK_PACKAGE_CONTACT}")
117+
set(CPACK_NSIS_MODIFY_PATH OFF)
123118
# set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "!include \"${CMAKE_SOURCE_DIR}/nsis_install.nsh\"")
124119
# set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "!include \"${CMAKE_SOURCE_DIR}/nsis_uninstall.nsh\"")
125-
endif(WIN32)
126-
#set (CPACK_OUTPUT_CONFIG_FILE)
127-
#set (CPACK_PACKAGE_EXECUTABLES)
128-
#set (CPACK_STRIP_FILES)
129-
set (CPACK_SOURCE_PACKAGE_FILE_NAME "nexus-source-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH}")
130-
#set (CPACK_SOURCE_STRIP_FILES)
131-
#set (CPACK_SOURCE_GENERATOR)
132-
#set (CPACK_SOURCE_OUTPUT_CONFIG_FILE)
133-
#set (CPACK_SOURCE_IGNORE_FILES)
134-
135-
# CPACK_PACKAGE_DESCRIPTION_SUMMARY "NeXus - NXDL class definitions, http://www.nexusformat.org/"
120+
set(CPACK_PACKAGE_ICON "@CMAKE_SOURCE_DIR_NATIVE_D@\\package\\nexus.ico")
121+
set(CPACK_NSIS_MUI_ICON "@CMAKE_SOURCE_DIR_NATIVE_D@\\package\\nexus.ico")
122+
set(CPACK_NSIS_MUI_UNIICON "@CMAKE_SOURCE_DIR_NATIVE_D@\\package\\nexus.ico")
123+
set(CPACK_NSIS_MENU_LINKS "manual/NeXusManual.html" "NeXus Manual" "definitions" "NeXus Definitions" "http://www.nexusformat.org/" "NeXus Web Site")
124+
endif()
125+
136126
cpack_add_component(definitions
137127
DISPLAY_NAME "NeXus NXDL definitions"
138128
DESCRIPTION "Binary applications such as nxconvert, nxbrowse etc..."
129+
# INSTALL_TYPES Full
130+
# GROUP definitions_group
139131
)
140132

141-
# CPACK_PACKAGE_DESCRIPTION_SUMMARY "NeXus - manual, http://www.nexusformat.org/"
142133
cpack_add_component(manual
143134
DISPLAY_NAME "NeXus Documentation"
144135
DESCRIPTION "NeXus User Guide and Reference Documentation with examples."
136+
# INSTALL_TYPES Full
137+
# GROUP manual_group
145138
)
146139

140+
#cpack_add_install_type(Full DISPLAY_NAME "Full")
141+
142+
#cpack_add_component_group(definitions_group
143+
# DISPLAY_NAME definitions
144+
# DESCRIPTION definitions
145+
# EXPANDED
146+
# BOLD_TITLE)
147+
148+
#cpack_add_component_group(manual_group
149+
# DISPLAY_NAME manual
150+
# DESCRIPTION manual
151+
# EXPANDED
152+
# BOLD_TITLE)
153+
147154
#cpack_add_component(Development
148155
# DISPLAY_NAME "Development"
149156
# DESCRIPTION "Development libraries and headers."

README.cmake.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ For example, in the top of the build directory run:
5454
But this is just an example.
5555
The sphinx version of the manual is not ready to use cmake.
5656

57+
If you are building a distribution kit on Windows using NSIS, see http://nsis.sourceforge.net/ZipDLL_plug-in if you get a ZipDLL error

manual/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#
2828
#====================================================================
2929

30-
find_program(DBLATEX dblatex)
3130

3231
set(XSLT_PATH ${CMAKE_SOURCE_DIR}/xslt)
3332
set (XSLT ${XSLT_PATH}/nxdl2docbook.xsl)

package/README.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README

package/WELCOME.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
WELCOME

package/nexus.ico

9.11 KB
Binary file not shown.

0 commit comments

Comments
 (0)