018e78575c
This allows us to create correct CMake config files when Qt is configured with directories outside of the prefix (which Qt allows), and also allows us to use correct values when a 'longer' relative lib directory is used such as lib/x86_64-linux-gnu. Change-Id: I6f88255a23752dc5b84cb20ce13fdeeee9d5ad51 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
95 lines
4.1 KiB
CMake
95 lines
4.1 KiB
CMake
|
|
get_filename_component(_qt5_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE)
|
|
|
|
set(Qt5$${CMAKE_MODULE_NAME}_VERSION_MAJOR "$$eval(QT.$${MODULE}.MAJOR_VERSION)")
|
|
set(Qt5$${CMAKE_MODULE_NAME}_VERSION_MINOR "$$eval(QT.$${MODULE}.MINOR_VERSION)")
|
|
set(Qt5$${CMAKE_MODULE_NAME}_VERSION_PATCH "$$eval(QT.$${MODULE}.PATCH_VERSION)")
|
|
|
|
set(Qt5$${CMAKE_MODULE_NAME}_LIBRARIES Qt5::$${CMAKE_MODULE_NAME})
|
|
|
|
!!IF isEmpty(CMAKE_INCLUDE_DIR_IS_ABSOLUTE)
|
|
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${_qt5_install_prefix}/$$CMAKE_INCLUDE_DIR\" \"${_qt5_install_prefix}/$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
|
|
!!ELSE
|
|
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
|
|
!!ENDIF
|
|
|
|
string(TOUPPER "$${CMAKE_MODULE_NAME}" _CMAKE_MODULE_NAME_UPPER)
|
|
set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -DQT_\${_CMAKE_MODULE_NAME_UPPER}_LIB)
|
|
set(Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS QT_\${_CMAKE_MODULE_NAME_UPPER}_LIB)
|
|
|
|
set(_Qt5_MODULE_DEPENDENCIES \"$${CMAKE_MODULE_DEPS}\")
|
|
|
|
foreach(_module_dep ${_Qt5_MODULE_DEPENDENCIES})
|
|
if (NOT Qt5${_module_dep}_FOUND)
|
|
find_package(Qt5${_module_dep} REQUIRED)
|
|
endif()
|
|
list(APPEND Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${Qt5${_module_dep}_INCLUDE_DIRS})
|
|
list(APPEND Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS ${Qt5${_module_dep}_DEFINITIONS})
|
|
list(APPEND Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS ${Qt5${_module_dep}_COMPILE_DEFINITIONS})
|
|
list(APPEND Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS ${Qt5${_module_dep}_EXECUTABLE_COMPILE_FLAGS})
|
|
endforeach()
|
|
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS)
|
|
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS)
|
|
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS)
|
|
if (Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
|
|
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
|
|
endif()
|
|
|
|
if (NOT _Qt5$${CMAKE_MODULE_NAME}_target)
|
|
set(_Qt5$${CMAKE_MODULE_NAME}_target 1)
|
|
!!IF !isEmpty(CMAKE_STATIC_TYPE)
|
|
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
|
|
!!ELSE
|
|
add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
|
|
!!ENDIF
|
|
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
|
|
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
|
|
!!ENDIF
|
|
endif()
|
|
|
|
!!IF !isEmpty(debug_type)
|
|
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
|
|
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
|
|
IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG \"$${CMAKE_QT5_MODULE_DEPS}\"
|
|
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
|
|
IMPORTED_LOCATION_DEBUG \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
|
|
!!ELSE
|
|
IMPORTED_LOCATION_DEBUG \"$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_DEBUG}\"
|
|
!!ENDIF
|
|
)
|
|
!!IF !isEmpty(CMAKE_IMPLIB_FILE_LOCATION_DEBUG)
|
|
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
|
|
IMPORTED_IMPLIB_DEBUG \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_DEBUG}\"
|
|
)
|
|
!!ENDIF
|
|
!!ENDIF
|
|
|
|
!!IF !isEmpty(release_type)
|
|
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
|
|
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
|
|
IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE \"$${CMAKE_QT5_MODULE_DEPS}\"
|
|
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
|
|
IMPORTED_LOCATION_RELEASE \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
|
|
!!ELSE
|
|
IMPORTED_LOCATION_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_LIB_FILE_LOCATION_RELEASE}\"
|
|
!!ENDIF
|
|
)
|
|
!!IF !isEmpty(CMAKE_IMPLIB_FILE_LOCATION_RELEASE)
|
|
set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
|
|
!!IF isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
|
|
IMPORTED_IMPLIB_RELEASE \"${_qt5_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\"
|
|
!!ELSE
|
|
IMPORTED_IMPLIB_RELEASE \"$${CMAKE_LIB_DIR}$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\"
|
|
!!ENDIF
|
|
)
|
|
!!ENDIF
|
|
!!ENDIF
|
|
|
|
!!IF !isEmpty(CMAKE_MODULE_EXTRAS)
|
|
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}ConfigExtras.cmake\")
|
|
!!ENDIF
|
|
|
|
!!IF !isEmpty(CMAKE_MODULE_MACROS)
|
|
include(\"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}Macros.cmake\")
|
|
!!ENDIF
|