diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2013-05-23 20:52:43 +0300 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2013-06-05 11:58:43 +0300 |
commit | a821ae1c6c005f0745b4b0cb9b6d8aeb270ada88 (patch) | |
tree | 465e68385f0b06d0c917889767d1f7f28adf23a7 | |
parent | 5bad049fd2192b6b00abde485f6e8171d68ca933 (diff) |
qt5: Rename the libraries and the package when building with qt5
This is to keep the libraries co-installable with the qt4 versions
-rw-r--r-- | CMakeLists.txt | 19 | ||||
-rw-r--r-- | cmake/modules/QtGStreamerConfig.cmake.in | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/QGlib/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/QGst/CMakeLists.txt | 30 |
5 files changed, 43 insertions, 34 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a1d8d5..540cae8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,10 +41,19 @@ macro_log_feature(Boost_FOUND "Boost" "Required for building QtGLib" "http://www # set the QTGSTREAMER_* cmake variables set(BUILDING_QTGSTREAMER TRUE) -set(QTGLIB_LIBRARY QtGLib) -set(QTGSTREAMER_LIBRARY QtGStreamer) -set(QTGSTREAMER_UI_LIBRARY QtGStreamerUi) -set(QTGSTREAMER_UTILS_LIBRARY QtGStreamerUtils) +if (USE_QT5) + set(QTGLIB_LIBRARY Qt5GLib) + set(QTGSTREAMER_LIBRARY Qt5GStreamer) + set(QTGSTREAMER_UI_LIBRARY Qt5GStreamerUi) + set(QTGSTREAMER_UTILS_LIBRARY Qt5GStreamerUtils) + set(QTGSTREAMER_PACKAGE_NAME Qt5GStreamer) +elseif (USE_QT4) + set(QTGLIB_LIBRARY QtGLib) + set(QTGSTREAMER_LIBRARY QtGStreamer) + set(QTGSTREAMER_UI_LIBRARY QtGStreamerUi) + set(QTGSTREAMER_UTILS_LIBRARY QtGStreamerUtils) + set(QTGSTREAMER_PACKAGE_NAME QtGStreamer) +endif() set(QTGSTREAMER_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src) include(QtGStreamerConfigCommon) @@ -106,7 +115,7 @@ if (CMAKE_COMPILER_IS_GNUCXX) endif () set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} CACHE STRING "Destination directory for libraries") -set(INCLUDES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/QtGStreamer) +set(INCLUDES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/${QTGSTREAMER_PACKAGE_NAME}) if (USE_GST_PLUGIN_DIR) set(PLUGINS_INSTALL_DIR ${GSTREAMER_PLUGIN_DIR}) diff --git a/cmake/modules/QtGStreamerConfig.cmake.in b/cmake/modules/QtGStreamerConfig.cmake.in index 5007382..2f349fe 100644 --- a/cmake/modules/QtGStreamerConfig.cmake.in +++ b/cmake/modules/QtGStreamerConfig.cmake.in @@ -5,7 +5,7 @@ set(QTGSTREAMER_VERSION @QTGSTREAMER_VERSION@) get_filename_component(_QTGSTREAMER_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) # include the generated QtGStreamerTargets.cmake from the same directory -find_file(_QTGSTREAMER_TARGETS_FILE QtGStreamerTargets.cmake +find_file(_QTGSTREAMER_TARGETS_FILE @QTGSTREAMER_PACKAGE_NAME@Targets.cmake PATHS ${_QTGSTREAMER_CONFIG_DIR} NO_DEFAULT_PATH) include(${_QTGSTREAMER_TARGETS_FILE}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1f6c54b..e553c0e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,4 +1,4 @@ -set(EXPORT_TARGET_SET QtGStreamerTargets) +set(EXPORT_TARGET_SET ${QTGSTREAMER_PACKAGE_NAME}Targets) if (QTGSTREAMER_STATIC) set(SHARED_OR_STATIC "STATIC") @@ -59,19 +59,19 @@ endif() include(CMakePackageConfigHelpers) configure_package_config_file( ${CMAKE_SOURCE_DIR}/cmake/modules/QtGStreamerConfig.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/QtGStreamerConfig.cmake - INSTALL_DESTINATION ${LIB_INSTALL_DIR}/QtGStreamer + ${CMAKE_CURRENT_BINARY_DIR}/${QTGSTREAMER_PACKAGE_NAME}Config.cmake + INSTALL_DESTINATION ${LIB_INSTALL_DIR}/${QTGSTREAMER_PACKAGE_NAME} PATH_VARS INCLUDES_INSTALL_DIR NO_CHECK_REQUIRED_COMPONENTS_MACRO) write_basic_package_version_file( - ${CMAKE_CURRENT_BINARY_DIR}/QtGStreamerConfigVersion.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${QTGSTREAMER_PACKAGE_NAME}ConfigVersion.cmake VERSION ${QTGSTREAMER_VERSION} COMPATIBILITY SameMajorVersion) -install(EXPORT ${EXPORT_TARGET_SET} DESTINATION ${LIB_INSTALL_DIR}/QtGStreamer) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QtGStreamerConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/QtGStreamerConfigVersion.cmake +install(EXPORT ${EXPORT_TARGET_SET} DESTINATION ${LIB_INSTALL_DIR}/${QTGSTREAMER_PACKAGE_NAME}) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${QTGSTREAMER_PACKAGE_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${QTGSTREAMER_PACKAGE_NAME}ConfigVersion.cmake ${CMAKE_SOURCE_DIR}/cmake/modules/QtGStreamerConfigCommon.cmake - DESTINATION ${LIB_INSTALL_DIR}/QtGStreamer) + DESTINATION ${LIB_INSTALL_DIR}/${QTGSTREAMER_PACKAGE_NAME}) # Install pkgconfig files file(GLOB_RECURSE PC_IN_FILES "*.pc.in") diff --git a/src/QGlib/CMakeLists.txt b/src/QGlib/CMakeLists.txt index 4a8d503..16bb628 100644 --- a/src/QGlib/CMakeLists.txt +++ b/src/QGlib/CMakeLists.txt @@ -45,13 +45,13 @@ include_directories(${GOBJECT_INCLUDE_DIR} ${GLIB2_INCLUDE_DIR}) run_codegen("QGlib" "${QtGLib_CODEGEN_INCLUDES}" "${QtGLib_CODEGEN_HEADERS}") # Build and link QtGLib -add_library(QtGLib ${SHARED_OR_STATIC} ${QtGLib_SRCS}) -set_target_properties(QtGLib PROPERTIES OUTPUT_NAME QtGLib-${QTGLIB_API_VERSION} +add_library(${QTGLIB_LIBRARY} ${SHARED_OR_STATIC} ${QtGLib_SRCS}) +set_target_properties(${QTGLIB_LIBRARY} PROPERTIES OUTPUT_NAME ${QTGLIB_LIBRARY}-${QTGLIB_API_VERSION} SOVERSION ${QTGLIB_SOVERSION} VERSION ${QTGSTREAMER_VERSION}) -target_link_libraries(QtGLib ${QT_QTCORE_LIBRARY} ${GOBJECT_LIBRARIES}) -target_link_libraries(QtGLib LINK_INTERFACE_LIBRARIES ${QT_QTCORE_LIBRARY}) +target_link_libraries(${QTGLIB_LIBRARY} ${QT_QTCORE_LIBRARY} ${GOBJECT_LIBRARIES}) +target_link_libraries(${QTGLIB_LIBRARY} LINK_INTERFACE_LIBRARIES ${QT_QTCORE_LIBRARY}) # Install -install(TARGETS QtGLib DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET}) +install(TARGETS ${QTGLIB_LIBRARY} DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET}) install_headers("QGlib" ${QtGLib_INSTALLED_HEADERS}) diff --git a/src/QGst/CMakeLists.txt b/src/QGst/CMakeLists.txt index 297e364..017329d 100644 --- a/src/QGst/CMakeLists.txt +++ b/src/QGst/CMakeLists.txt @@ -143,33 +143,33 @@ endif() run_codegen("QGst" "${QtGStreamer_CODEGEN_INCLUDES}" "${QtGStreamer_CODEGEN_HEADERS}") # Build and link QtGStreamer -add_library(QtGStreamer ${SHARED_OR_STATIC} ${QtGStreamer_SRCS}) -set_target_properties(QtGStreamer PROPERTIES OUTPUT_NAME QtGStreamer-${QTGSTREAMER_API_VERSION} +add_library(${QTGSTREAMER_LIBRARY} ${SHARED_OR_STATIC} ${QtGStreamer_SRCS}) +set_target_properties(${QTGSTREAMER_LIBRARY} PROPERTIES OUTPUT_NAME ${QTGSTREAMER_LIBRARY}-${QTGSTREAMER_API_VERSION} SOVERSION ${QTGSTREAMER_SOVERSION} VERSION ${QTGSTREAMER_VERSION}) -target_link_libraries(QtGStreamer ${QTGLIB_LIBRARY} ${GOBJECT_LIBRARIES} +target_link_libraries(${QTGSTREAMER_LIBRARY} ${QTGLIB_LIBRARY} ${GOBJECT_LIBRARIES} ${GSTREAMER_LIBRARY} ${GSTREAMER_INTERFACES_LIBRARY} ${GSTREAMER_PBUTILS_LIBRARY}) -target_link_libraries(QtGStreamer LINK_INTERFACE_LIBRARIES ${QTGLIB_LIBRARY}) +target_link_libraries(${QTGSTREAMER_LIBRARY} LINK_INTERFACE_LIBRARIES ${QTGLIB_LIBRARY}) # Build and link QtGStreamerUi -add_library(QtGStreamerUi ${SHARED_OR_STATIC} ${QtGStreamerUi_SRCS}) -set_target_properties(QtGStreamerUi PROPERTIES OUTPUT_NAME QtGStreamerUi-${QTGSTREAMER_API_VERSION} +add_library(${QTGSTREAMER_UI_LIBRARY} ${SHARED_OR_STATIC} ${QtGStreamerUi_SRCS}) +set_target_properties(${QTGSTREAMER_UI_LIBRARY} PROPERTIES OUTPUT_NAME ${QTGSTREAMER_UI_LIBRARY}-${QTGSTREAMER_API_VERSION} SOVERSION ${QTGSTREAMER_UI_SOVERSION} VERSION ${QTGSTREAMER_VERSION}) -target_link_libraries(QtGStreamerUi ${QT_QTGUI_LIBRARY} ${QTGSTREAMER_LIBRARY} ${QtGStreamerUi_GL_LIBS}) -target_link_libraries(QtGStreamerUi LINK_INTERFACE_LIBRARIES ${QT_QTGUI_LIBRARY} ${QTGSTREAMER_LIBRARY}) +target_link_libraries(${QTGSTREAMER_UI_LIBRARY} ${QT_QTGUI_LIBRARY} ${QTGSTREAMER_LIBRARY} ${QtGStreamerUi_GL_LIBS}) +target_link_libraries(${QTGSTREAMER_UI_LIBRARY} LINK_INTERFACE_LIBRARIES ${QT_QTGUI_LIBRARY} ${QTGSTREAMER_LIBRARY}) # Build and link QtGStreamerUtils -add_library(QtGStreamerUtils ${SHARED_OR_STATIC} ${QtGStreamerUtils_SRCS}) -set_target_properties(QtGStreamerUtils PROPERTIES OUTPUT_NAME QtGStreamerUtils-${QTGSTREAMER_API_VERSION} +add_library(${QTGSTREAMER_UTILS_LIBRARY} ${SHARED_OR_STATIC} ${QtGStreamerUtils_SRCS}) +set_target_properties(${QTGSTREAMER_UTILS_LIBRARY} PROPERTIES OUTPUT_NAME ${QTGSTREAMER_UTILS_LIBRARY}-${QTGSTREAMER_API_VERSION} SOVERSION ${QTGSTREAMER_UTILS_SOVERSION} VERSION ${QTGSTREAMER_VERSION}) -target_link_libraries(QtGStreamerUtils ${QTGSTREAMER_LIBRARY} ${GSTREAMER_LIBRARY} ${GSTREAMER_APP_LIBRARY}) -target_link_libraries(QtGStreamerUtils LINK_INTERFACE_LIBRARIES ${QTGSTREAMER_LIBRARY}) +target_link_libraries(${QTGSTREAMER_UTILS_LIBRARY} ${QTGSTREAMER_LIBRARY} ${GSTREAMER_LIBRARY} ${GSTREAMER_APP_LIBRARY}) +target_link_libraries(${QTGSTREAMER_UTILS_LIBRARY} LINK_INTERFACE_LIBRARIES ${QTGSTREAMER_LIBRARY}) # Install -install(TARGETS QtGStreamer DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET}) -install(TARGETS QtGStreamerUi DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET}) -install(TARGETS QtGStreamerUtils DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET}) +install(TARGETS ${QTGSTREAMER_LIBRARY} DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET}) +install(TARGETS ${QTGSTREAMER_UI_LIBRARY} DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET}) +install(TARGETS ${QTGSTREAMER_UTILS_LIBRARY} DESTINATION ${LIB_INSTALL_DIR} EXPORT ${EXPORT_TARGET_SET}) install_headers("QGst" ${QtGStreamer_INSTALLED_HEADERS}) |