Wizards/CMake: Make sure GNUInstallDirs is included

Qt 6.4 automatically includes GNUInstallDirs, but before that it didn't.
And for the "plain" projects Qt isn't even used. Since the project
templates use CMAKE_INSTALL_LIBDIR etc, they must ensure themselves that
these are actually available.

Fixes: QTCREATORBUG-29067
Change-Id: Id304b829301a33720d8f6c4a9c89157e8fc1c4a9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Eike Ziller
2023-07-04 09:19:42 +02:00
parent 20cb9b6e69
commit 0c31474ed3
9 changed files with 9 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ if (LINK_INSIGHT)
include(${CMAKE_CURRENT_SOURCE_DIR}/insight)
endif ()
include(GNUInstallDirs)
install(TARGETS %{ProjectName}App
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

View File

@@ -24,6 +24,7 @@ endif()
target_link_libraries(%{ProjectName} PRIVATE Qt${QT_VERSION_MAJOR}::%{QtModule})
include(GNUInstallDirs)
install(TARGETS %{ProjectName}
@if %{MacOSBundle}
BUNDLE DESTINATION .

View File

@@ -35,6 +35,7 @@ else()
endif()
@endif
include(GNUInstallDirs)
install(TARGETS %{ProjectName}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}

View File

@@ -4,6 +4,7 @@ project(%{ProjectName} LANGUAGES C)
add_executable(%{ProjectName} %{CFileName})
include(GNUInstallDirs)
install(TARGETS %{ProjectName}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}

View File

@@ -7,6 +7,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(%{ProjectName} %{CppFileName})
include(GNUInstallDirs)
install(TARGETS %{ProjectName}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}

View File

@@ -39,6 +39,7 @@ target_link_libraries(%{TargetName}
PRIVATE Qt6::Quick
)
include(GNUInstallDirs)
install(TARGETS %{TargetName}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

View File

@@ -28,6 +28,7 @@ set_target_properties(%{TargetName} PROPERTIES
target_link_libraries(%{TargetName}
PRIVATE Qt6::Quick)
include(GNUInstallDirs)
install(TARGETS %{TargetName}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@@ -69,6 +69,7 @@ set_target_properties(%{ProjectName} PROPERTIES
WIN32_EXECUTABLE TRUE
)
include(GNUInstallDirs)
install(TARGETS %{ProjectName}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

View File

@@ -72,6 +72,7 @@ set_target_properties(%{ProjectName} PROPERTIES
WIN32_EXECUTABLE TRUE
)
include(GNUInstallDirs)
install(TARGETS %{ProjectName}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}