You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qaccessibilityclient/0012-Add-suffix-to-the-Qt5-...

132 lines
6.2 KiB

From 7a59179efc11903ce1123726a96b5017d4f76f16 Mon Sep 17 00:00:00 2001
From: Luigi Toscano <luigi.toscano@tiscali.it>
Date: Wed, 19 Apr 2017 01:44:05 +0200
Subject: [PATCH 12/12] Add suffix to the Qt5 build to allow co-installability
Summary: See for example qca or other libraries.
Test Plan: The qt5 version compiles with a different prefix
Reviewers: gladhorn, whiting
Reviewed By: gladhorn
Differential Revision: https://phabricator.kde.org/D5518
---
CMakeLists.txt | 2 ++
QAccessibilityClientConfig.cmake.in | 2 +-
examples/accessibleapps/CMakeLists.txt | 7 ++++++-
src/CMakeLists.txt | 10 +++++-----
tests/auto/CMakeLists.txt | 8 ++++----
5 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 76c92df..be18d4d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -35,6 +35,7 @@ if (QT5_BUILD)
message("Using Qt 5")
add_definitions(${Qt5Core_DEFINITIONS} ${Qt5Widgets_DEFINITIONS} ${Qt5DBus_DEFINITIONS})
include_directories(${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS})
+ set(LIBNAME_SUFFIX "-qt5")
else (QT5_BUILD)
find_package(Qt4 REQUIRED)
if (${QT4_FOUND})
@@ -45,6 +46,7 @@ else (QT5_BUILD)
endif (${QT4_FOUND})
endif (QT5_BUILD)
+set(QACCESSIBILITYCLIENT_LIB_NAME "qaccessibilityclient${LIBNAME_SUFFIX}")
set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR})
diff --git a/QAccessibilityClientConfig.cmake.in b/QAccessibilityClientConfig.cmake.in
index 9634bff..47dc333 100644
--- a/QAccessibilityClientConfig.cmake.in
+++ b/QAccessibilityClientConfig.cmake.in
@@ -10,5 +10,5 @@ set(QACCESSIBILITYCLIENT_VERSION_PATCH @QACCESSIBILITYCLIENT_VERSION_PATCH@)
set(QACCESSIBILITYCLIENT_VERSION ${QACCESSIBILITYCLIENT_VERSION_MAJOR}.${QACCESSIBILITYCLIENT_VERSION_MINOR}.${QACCESSIBILITYCLIENT_VERSION_PATCH})
set(QACCESSIBILITYCLIENT_INCLUDE_DIR "@QACCESSIBILITYCLIENT_INCLUDE_DIR@")
-set(QACCESSIBILITYCLIENT_LIBRARY qaccessibilityclient)
+set(QACCESSIBILITYCLIENT_LIBRARY @QACCESSIBILITYCLIENT_LIB_NAME@)
diff --git a/examples/accessibleapps/CMakeLists.txt b/examples/accessibleapps/CMakeLists.txt
index ab9fb40..a6242f1 100644
--- a/examples/accessibleapps/CMakeLists.txt
+++ b/examples/accessibleapps/CMakeLists.txt
@@ -39,6 +39,11 @@ else (QT5_BUILD)
endif (QT5_BUILD)
add_executable(accessibleapps ${accessibleapps_SRCS} ${accessibleapps_MOC} ${accessibleapps_UI_HDRS})
-target_link_libraries(accessibleapps ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBRARY} qaccessibilityclient)
+
+if (QT5_BUILD)
+ target_link_libraries(accessibleapps ${Qt5Widgets_LIBRARIES} ${Qt5Test_LIBRARIES} ${QACCESSIBILITYCLIENT_LIB_NAME})
+else ()
+ target_link_libraries(accessibleapps ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${KDE4_KDEUI_LIBRARY} ${QACCESSIBILITYCLIENT_LIB_NAME})
+endif()
install(TARGETS accessibleapps DESTINATION bin)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index ade53e0..1d08854 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,22 +19,22 @@ set(QAccessibilityClientPrivate_SRCS
atspi/qt-atspi.cpp
)
-add_library(qaccessibilityclient SHARED ${QAccessibilityClient_SRCS} ${QAccessibilityClientPrivate_SRCS})
+add_library(${QACCESSIBILITYCLIENT_LIB_NAME} SHARED ${QAccessibilityClient_SRCS} ${QAccessibilityClientPrivate_SRCS})
if (QT5_BUILD)
- target_link_libraries(qaccessibilityclient ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5DBus_LIBRARIES})
+ target_link_libraries(${QACCESSIBILITYCLIENT_LIB_NAME} ${Qt5Core_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5DBus_LIBRARIES})
else (QT5_BUILD)
- target_link_libraries(qaccessibilityclient ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTGUI_LIBRARY})
+ target_link_libraries(${QACCESSIBILITYCLIENT_LIB_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTGUI_LIBRARY})
endif(QT5_BUILD)
set(QACCESSIBILITYCLIENT_SOVERSION ${QACCESSIBILITYCLIENT_VERSION_MAJOR})
-set_target_properties(qaccessibilityclient
+set_target_properties(${QACCESSIBILITYCLIENT_LIB_NAME}
PROPERTIES VERSION ${QACCESSIBILITYCLIENT_VERSION}
SOVERSION ${QACCESSIBILITYCLIENT_SOVERSION}
)
-install(TARGETS qaccessibilityclient EXPORT QAccessibilityClient ${INSTALL_TARGETS_DEFAULT_ARGS})
+install(TARGETS ${QACCESSIBILITYCLIENT_LIB_NAME} EXPORT QAccessibilityClient ${INSTALL_TARGETS_DEFAULT_ARGS})
install(EXPORT QAccessibilityClient DESTINATION ${_QAccessibilityClient_CONFIG_DEST})
########### install files ###############
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
index b02f41d..b417010 100644
--- a/tests/auto/CMakeLists.txt
+++ b/tests/auto/CMakeLists.txt
@@ -21,9 +21,9 @@ set(tst_accessibilityclient_SRCS
add_executable(tst_accessibilityclient ${tst_accessibilityclient_SRCS})
if (QT5_BUILD)
- target_link_libraries(tst_accessibilityclient ${Qt5Widgets_LIBRARIES} ${Qt5Test_LIBRARIES} qaccessibilityclient)
+ target_link_libraries(tst_accessibilityclient ${Qt5Widgets_LIBRARIES} ${Qt5Test_LIBRARIES} ${QACCESSIBILITYCLIENT_LIB_NAME})
else (QT5_BUILD)
- target_link_libraries(tst_accessibilityclient ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${QT_QTDBUS_LIBRARY} qaccessibilityclient)
+ target_link_libraries(tst_accessibilityclient ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QACCESSIBILITYCLIENT_LIB_NAME})
endif (QT5_BUILD)
add_test(libkdeaccessibilityclient-tst_accessibilityclient tst_accessibilityclient)
@@ -36,7 +36,7 @@ add_executable(simplewidgetapp ${simplewidgetapp_SRCS})
if (QT5_BUILD)
- target_link_libraries(simplewidgetapp ${Qt5Widgets_LIBRARIES} ${Qt5Test_LIBRARIES} qaccessibilityclient)
+ target_link_libraries(simplewidgetapp ${Qt5Widgets_LIBRARIES} ${Qt5Test_LIBRARIES} ${QACCESSIBILITYCLIENT_LIB_NAME})
else (QT5_BUILD)
- target_link_libraries(simplewidgetapp ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${QT_QTDBUS_LIBRARY} qaccessibilityclient)
+ target_link_libraries(simplewidgetapp ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTTEST_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QACCESSIBILITYCLIENT_LIB_NAME})
endif (QT5_BUILD)
--
2.9.4