Skip to content

Commit 809414d

Browse files
committed
CMake: fix Windows installer start menu links, avoid usage of internal CPack var name
1 parent 34719d6 commit 809414d

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

cmake/LSLCMake.cmake

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,6 @@ function(installLSLApp target)
7070
AUTORCC ON
7171
)
7272
endif()
73-
# add start menu shortcut if supported by installer
74-
set_property(INSTALL "${PROJECT_NAME}/$<TARGET_FILE_NAME:${target}>" PROPERTY
75-
CPACK_START_MENU_SHORTCUTS "${target}")
76-
7773

7874
# Set runtime path, i.e. where shared libs are searched relative to the exe
7975
set(LIBDIRGENEXPR "../$<IF:$<BOOL:${LSL_UNIXFOLDERS}>,lib/,LSL/lib/>")
@@ -93,6 +89,10 @@ function(installLSLApp target)
9389
set(CMAKE_INSTALL_LIBDIR ${PROJECT_NAME})
9490
set(lsldir "\${CMAKE_INSTALL_PREFIX}/LSL")
9591
endif()
92+
93+
# add start menu shortcut if supported by installer
94+
set_property(INSTALL "${CMAKE_INSTALL_BINDIR}/$<TARGET_FILE_NAME:${target}>" PROPERTY
95+
CPACK_START_MENU_SHORTCUTS "${target}")
9696

9797
# install additional library dependencies supplied after the target argument
9898
foreach(libdependency ${ARGN})
@@ -122,7 +122,7 @@ function(installLSLApp target)
122122
# Some Windows installers have problems with several components having the same file,
123123
# so libs shared between targets are copied into the SHAREDLIBCOMPONENT component if set
124124
if(NOT SHAREDLIBCOMPONENT)
125-
set(SHAREDLIBCOMPONENT ${target})
125+
set(SHAREDLIBCOMPONENT ${PROJECT_NAME})
126126
endif()
127127

128128
# For MacOS we need to know if the installed target will be a .app bundle...
@@ -368,16 +368,16 @@ macro(LSLGenerateCPackConfig)
368368
set(LSL_OS "Linux${lslplatform}-${LSB_RELEASE_CODENAME}")
369369
endif()
370370
set(CPACK_GENERATOR ${LSL_CPACK_DEFAULT_GEN} CACHE STRING "CPack pkg type(s) to generate")
371-
get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
372-
foreach(component ${CPACK_COMPONENTS_ALL})
371+
get_cmake_property(LSL_COMPONENTS COMPONENTS)
372+
foreach(component ${LSL_COMPONENTS})
373373
string(TOUPPER ${component} COMPONENT)
374374
set(LSL_CPACK_FILENAME "${component}-${PROJECT_VERSION}-${LSL_OS}")
375375
get_property(LSLDEPENDS GLOBAL PROPERTY "LSLDEPENDS_${component}")
376376
if(LSLDEPENDS)
377377
list(REMOVE_DUPLICATES LSLDEPENDS)
378378
# remove dependencies we don't package ourselves
379379
set(MISSING ${LSLDEPENDS})
380-
list(REMOVE_ITEM MISSING ${CPACK_COMPONENTS_ALL})
380+
list(REMOVE_ITEM MISSING ${LSL_COMPONENTS})
381381
if(MISSING)
382382
list(REMOVE_ITEM LSLDEPENDS ${MISSING})
383383
endif()
@@ -387,10 +387,9 @@ macro(LSLGenerateCPackConfig)
387387
set("CPACK_DEBIAN_${COMPONENT}_PACKAGE_NAME" ${component})
388388
set("CPACK_DEBIAN_${COMPONENT}_FILE_NAME" "${LSL_CPACK_FILENAME}.deb")
389389
set("CPACK_ARCHIVE_${COMPONENT}_FILE_NAME" ${LSL_CPACK_FILENAME})
390-
#set(CPACK_DEBIAN_${component}_FILE_NAME "${FILENAME}.deb")
391390
endforeach()
392391

393-
message(STATUS "Installing Components: ${CPACK_COMPONENTS_ALL}")
392+
message(STATUS "Installing Components: ${LSL_COMPONENTS}")
394393
include(CPack)
395394
endif()
396395
endmacro()

0 commit comments

Comments
 (0)