fix: must set CMAKE_INSTALL_PREFIX before GNUInstallDirs

Log:
Never modify the value of CMAKE_INSTALL_PREFIX after including GNUInstallDirs ,Otherwise incorrect CMAKE_INSTALL_FULL_XXXX values will be computed
This commit is contained in:
rewine 2023-05-04 11:20:04 +08:00 committed by deepin-bot[bot]
parent a1af30c814
commit cda8e2c746
2 changed files with 4 additions and 8 deletions

View File

@ -31,6 +31,10 @@ endif()
# generate a compile commands file as complete database for vim-YouCompleteMe or some other similar tools
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Install settings
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif ()
include(GNUInstallDirs)
if (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug"))
@ -130,11 +134,6 @@ add_subdirectory("frame")
add_subdirectory("plugins")
#add_subdirectory("tests")
# Install settings
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX /usr)
endif ()
## qm files
file(GLOB QM_FILES "translations/*.qm")
install(FILES ${QM_FILES}

View File

@ -94,8 +94,5 @@ target_link_libraries(${PLUGIN_NAME} PRIVATE
${DdeDockInterface_LIBRARIES}
)
# 设置安装路径的前缀(默认为"/usr/local")
set(CMAKE_INSTALL_PREFIX "/usr")
# make install install
install(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION lib/dde-dock/plugins)