Skip to content

Commit 9bcbdb3

Browse files
committed
Improvements and cleanups to non-clobber install of packages
1 parent bf204af commit 9bcbdb3

4 files changed

Lines changed: 19 additions & 19 deletions

File tree

‎superbuild/CMakeLists.txt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ if (POLICY CMP0135)
3636
cmake_policy(SET CMP0135 NEW) # 3.24
3737
endif ()
3838

39+
if (POLICY CMP0114)
40+
cmake_policy(SET CMP0114 NEW) # 3.19
41+
endif ()
42+
3943
include(ExternalProject)
44+
set_property(DIRECTORY PROPERTY EP_STEP_TARGETS download) # parallel downloads
4045
include(GNUInstallDirs)
4146
include(ProcessorCount)
4247

‎superbuild/dependencies/dep_embree.cmake‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,17 +68,17 @@ else()
6868
INSTALL_COMMAND "${CMAKE_COMMAND}"
6969
-DSRC=<SOURCE_DIR>
7070
-DDST=${COMPONENT_PATH}
71-
-DMANIFEST=<BINARY_DIR>/install_manifest.txt
71+
-DMANIFEST=<BINARY_DIR>/package_manifest.txt
7272
-P ${CMAKE_CURRENT_LIST_DIR}/package_install.cmake
7373
BUILD_ALWAYS OFF
7474
)
7575

76-
# the package bundles TBB, install after ours to keep it
77-
ExternalProject_Add_StepDependencies(${COMPONENT_NAME}
78-
install
79-
$<$<BOOL:${BUILD_TBB}>:tbb>
80-
)
81-
76+
if (NOT INSTALL_IN_SEPARATE_DIRECTORIES) # bundled deps must not win
77+
ExternalProject_Add_StepDependencies(${COMPONENT_NAME}
78+
install
79+
$<$<BOOL:${BUILD_TBB}>:tbb>
80+
)
81+
endif()
8282
endif()
8383

8484
add_to_prefix_path(${COMPONENT_PATH})

‎superbuild/dependencies/dep_rkcommon.cmake‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ ExternalProject_Add(${COMPONENT_NAME}
4242
BUILD_ALWAYS ${ALWAYS_REBUILD}
4343
)
4444

45-
if (BUILD_TBB)
46-
ExternalProject_Add_StepDependencies(${COMPONENT_NAME} configure tbb)
47-
endif()
45+
ExternalProject_Add_StepDependencies(${COMPONENT_NAME}
46+
configure
47+
$<$<BOOL:${BUILD_TBB}>:tbb>
48+
)
4849

4950
add_to_prefix_path(${COMPONENT_PATH})
5051

‎superbuild/dependencies/package_install.cmake‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,13 @@
33

44
# Installs an unpacked pre-built package into DST, keeping files another
55
# component installed there already: the packages bundle their dependencies,
6-
# which the superbuild builds first, thus first writer wins. Files of the
7-
# previous install are removed, thus version bumps still replace them.
6+
# which the superbuild installs first, thus first writer wins. Files of the
7+
# previous install (MANIFEST) are removed first, so version bumps replace them.
88
#
99
# cmake -DSRC=<dir> -DDST=<dir> -DMANIFEST=<file> -P <this file>
1010

1111
cmake_minimum_required(VERSION 3.10)
1212

13-
foreach (ARG SRC DST MANIFEST)
14-
if (NOT ${ARG})
15-
message(FATAL_ERROR "package_install.cmake: ${ARG} not set")
16-
endif()
17-
endforeach()
18-
1913
if (EXISTS "${MANIFEST}")
2014
file(STRINGS "${MANIFEST}" PREVIOUS)
2115
foreach (FILE IN LISTS PREVIOUS)
@@ -26,7 +20,7 @@ endif()
2620
file(GLOB_RECURSE FILES RELATIVE "${SRC}" "${SRC}/*")
2721
set(INSTALLED "")
2822
foreach (FILE IN LISTS FILES)
29-
if (NOT EXISTS "${DST}/${FILE}")
23+
if (NOT EXISTS "${DST}/${FILE}" AND NOT IS_SYMLINK "${DST}/${FILE}")
3024
get_filename_component(DIR "${FILE}" DIRECTORY)
3125
file(COPY "${SRC}/${FILE}" DESTINATION "${DST}/${DIR}")
3226
list(APPEND INSTALLED "${FILE}")

0 commit comments

Comments
 (0)