Skip to content

Commit e86af46

Browse files
committed
packaging: do not put install manifest in the install location.
Instead, a new option INSTALL_MANIFEST gives location of the manifest file.
1 parent 2ca7faf commit e86af46

File tree

3 files changed

+20
-23
lines changed

3 files changed

+20
-23
lines changed

packaging/CMakeLists.txt

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,25 @@
3131
# Install manifest
3232
# ======================================================================
3333

34-
# Generate and install install_manifest.cmake file which contains
35-
# information about install components and files in each component.
34+
# If requested, generate install manifest file which contains information
35+
# about install components and files in each component. INSTALL_MANIFEST
36+
# should be a path to the manifest file.
3637
# See the install_mainfest.cmake script in this directory.
3738

39+
if(DEFINED INSTALL_MANIFEST)
40+
3841
add_custom_target(generate_manifest
3942
ALL
4043
COMMAND ${CMAKE_COMMAND}
41-
-D INSTALL_DIR=${CMAKE_INSTALL_PREFIX}
44+
-D MANIFEST_FILE=${INSTALL_MANIFEST}
4245
-D BUILD_DIR=${PROJECT_BINARY_DIR}
4346
-D CONFIG=$<CONFIG>
4447
-P "${CMAKE_CURRENT_SOURCE_DIR}/install_manifest.cmake"
4548
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
4649
COMMENT "Generating install manifest"
4750
)
4851

49-
install(
50-
FILES "${PROJECT_BINARY_DIR}/install_manifest.cmake"
51-
DESTINATION .
52-
COMPONENT Auxiliary
53-
)
52+
endif()
5453

5554

5655
# ======================================================================

packaging/WiX/CMakeLists.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,18 @@ cmake_minimum_required(VERSION 3.0)
2626
# Build MSI package from files installed in CMAKE_INSTALL_PREFIX location.
2727
#
2828
# Usage:
29-
# cmake -D CMAKE_INSTALL_PREFIX=<install loc> ... <src>/packaging/WiX
29+
# cmake -D CMAKE_INSTALL_PREFIX=<install loc>
30+
# -D INSTALL_MANIFEST=<manifest file> ... <src>/packaging/WiX
3031
# cmake --build . --target MSI
3132
# cmake --build . --target ZIP
3233
#
3334
# This should be invoked (in a dedicated location) after building and
3435
# installing main connector project. CMAKE_INSTALL_PREFIX should point
35-
# at install location of the main project. It is expected that it contains
36-
# install_manifest.cmake which describes install components defined in
37-
# the project and which is generated if connector was built under
38-
# WITH_PACKAGES option.
36+
# at install location of the main project. INSTALL_MANIFEST should point
37+
# at install manifest file generated by the builds (this happens if the
38+
# same INSTALL_MANIFEST option is given together with WITH_PACKAGES during
39+
# the builds). The manifest file describes install components defined in
40+
# the project.
3941
#
4042
# Generating MSI package
4143
# ----------------------
@@ -47,13 +49,13 @@ cmake_minimum_required(VERSION 3.0)
4749
# Some other options might need to be specified to correctly generate
4850
# the .wxs definition. For example STATIC_MSVCRT or
4951
# BUNDLE_RUNTIME_LIBRARIES. Otherwise most of the information is taken
50-
# from install_manifest.cmake and version.cmake, packaging/PackageSpecs.cmake
52+
# from the install manifest and version.cmake, packaging/PackageSpecs.cmake
5153
# files in the main project sources.
5254
#
5355
# Generating ZIP package
5456
# ----------------------
5557
# ZIP package simply includes all the files from the given install
56-
# location (excluding install_manifest.cmake etc.)
58+
# location.
5759
#
5860

5961
IF(NOT WIN32)
@@ -75,16 +77,15 @@ if(NOT EXISTS "${BASE_DIR}/packaging/WiX")
7577
endif()
7678

7779
#
78-
# Check the install location
80+
# Check the install location and the manifest file
7981
#
8082

8183
file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} INSTALL_DIR)
82-
set(INSTALL_MANIFEST ${INSTALL_DIR}/install_manifest.cmake)
8384

8485
if(NOT EXISTS ${INSTALL_MANIFEST})
8586
message(FATAL_ERROR
86-
"Could not find install_manifest.cmake in the install location:"
87-
" ${CMAKE_INSTALL_PREFIX}"
87+
"Could not find specified install manifest file:"
88+
" ${INSTALL_MANIFEST}"
8889
)
8990
endif()
9091

packaging/install_manifest.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@
4545
# the same install location).
4646
#
4747

48-
# The output file
49-
50-
set(MANIFEST_FILE ${BUILD_DIR}/install_manifest.cmake)
5148

5249
# Check if requiret input files exist
5350

@@ -62,7 +59,7 @@ endif()
6259
# Read existing information to be extended (if present) and CPackConfig.cmake
6360
# to get list of install components. Update COMPONENTS basead on this.
6461

65-
include("${INSTALL_DIR}/install_manifest.cmake" OPTIONAL)
62+
include("${MANIFEST_FILE}" OPTIONAL)
6663
include("${BUILD_DIR}/CPackConfig.cmake")
6764

6865
list(APPEND COMPONENTS ${CPACK_COMPONENTS_ALL})

0 commit comments

Comments
 (0)