|
Rex Dieter |
0dba7d1 |
From 1295e1bbca68c9dd73719436319324a75d9a68a1 Mon Sep 17 00:00:00 2001
|
|
Rex Dieter |
0dba7d1 |
From: Rex Dieter <rdieter@math.unl.edu>
|
|
Rex Dieter |
0dba7d1 |
Date: Sun, 8 Nov 2015 07:26:57 -0600
|
|
Rex Dieter |
0dba7d1 |
Subject: [PATCH] support QJSON_SUFFIX, to be parallel-installable
|
|
Rex Dieter |
0dba7d1 |
|
|
Rex Dieter |
0dba7d1 |
Support full parallel-installability of Qt4/Qt5 builds. Besides,
|
|
Rex Dieter |
0dba7d1 |
Qt5 builds are binary incompatible anyway, so should not be using
|
|
Rex Dieter |
0dba7d1 |
the same library soname.
|
|
Rex Dieter |
0dba7d1 |
---
|
|
Rex Dieter |
0dba7d1 |
CMakeLists.txt | 17 +++++++++--------
|
|
Rex Dieter |
0dba7d1 |
src/CMakeLists.txt | 16 ++++++++--------
|
|
Rex Dieter |
0dba7d1 |
tests/benchmarks/CMakeLists.txt | 2 +-
|
|
Rex Dieter |
0dba7d1 |
tests/cmdline_tester/CMakeLists.txt | 2 +-
|
|
Rex Dieter |
0dba7d1 |
tests/parser/CMakeLists.txt | 2 +-
|
|
Rex Dieter |
0dba7d1 |
tests/qobjecthelper/CMakeLists.txt | 2 +-
|
|
Rex Dieter |
0dba7d1 |
tests/scanner/CMakeLists.txt | 2 +-
|
|
Rex Dieter |
0dba7d1 |
tests/serializer/CMakeLists.txt | 2 +-
|
|
Rex Dieter |
0dba7d1 |
8 files changed, 23 insertions(+), 22 deletions(-)
|
|
Rex Dieter |
0dba7d1 |
|
|
Rex Dieter |
0dba7d1 |
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
index a7c9e60..64e6ee0 100755
|
|
Rex Dieter |
0dba7d1 |
--- a/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
+++ b/CMakeLists.txt
|
|
Rex Dieter |
c5a9d58 |
@@ -51,6 +51,7 @@ IF (Qt5Core_FOUND)
|
|
Rex Dieter |
c5a9d58 |
INCLUDE_DIRECTORIES(${Qt5Core_INCLUDE_DIRS})
|
|
Rex Dieter |
c5a9d58 |
ADD_DEFINITIONS(${Qt5Core_DEFINITIONS})
|
|
Rex Dieter |
c5a9d58 |
SET(PC_Requires "Qt5Core")
|
|
Rex Dieter |
c5a9d58 |
+ set(QJSON_SUFFIX "-qt5")
|
|
Rex Dieter |
c5a9d58 |
# Tell CMake to run moc when necessary:
|
|
Rex Dieter |
c5a9d58 |
set(CMAKE_AUTOMOC ON)
|
|
Rex Dieter |
c5a9d58 |
# As moc files are generated in the binary dir, tell CMake
|
|
Rex Dieter |
c5a9d58 |
@@ -75,7 +76,7 @@ ENDIF()
|
|
Rex Dieter |
c5a9d58 |
SET (LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
|
|
Rex Dieter |
c5a9d58 |
SET (LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Directory where lib will install")
|
|
Rex Dieter |
c5a9d58 |
SET (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in")
|
|
Rex Dieter |
c5a9d58 |
-SET (CMAKECONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${CMAKE_PROJECT_NAME}" CACHE PATH "Directory where to install QJSONConfig.cmake")
|
|
Rex Dieter |
c5a9d58 |
+SET (CMAKECONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${CMAKE_PROJECT_NAME}${QJSON_SUFFIX}" CACHE PATH "Directory where to install QJSONConfig.cmake")
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
set(QJSON_LIB_MAJOR_VERSION "0")
|
|
Rex Dieter |
c5a9d58 |
set(QJSON_LIB_MINOR_VERSION "8")
|
|
Rex Dieter |
0dba7d1 |
@@ -88,9 +89,9 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" )
|
|
Rex Dieter |
c5a9d58 |
# pkg-config
|
|
Rex Dieter |
c5a9d58 |
IF (NOT WIN32)
|
|
Rex Dieter |
c5a9d58 |
CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/QJson.pc.in
|
|
Rex Dieter |
c5a9d58 |
- ${CMAKE_CURRENT_BINARY_DIR}/QJson.pc
|
|
Rex Dieter |
c5a9d58 |
+ ${CMAKE_CURRENT_BINARY_DIR}/QJson${QJSON_SUFFIX}.pc
|
|
Rex Dieter |
c5a9d58 |
@ONLY)
|
|
Rex Dieter |
c5a9d58 |
- INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/QJson.pc
|
|
Rex Dieter |
c5a9d58 |
+ INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/QJson${QJSON_SUFFIX}.pc
|
|
Rex Dieter |
c5a9d58 |
DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
|
|
Rex Dieter |
c5a9d58 |
ENDIF (NOT WIN32)
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
@@ -106,7 +107,7 @@ CONFIGURE_FILE(
|
|
Rex Dieter |
c5a9d58 |
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
Rex Dieter |
c5a9d58 |
IMMEDIATE @ONLY)
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
-INSTALL(EXPORT qjson-export DESTINATION ${CMAKECONFIG_INSTALL_DIR} FILE QJSONTargets.cmake)
|
|
Rex Dieter |
c5a9d58 |
+INSTALL(EXPORT qjson-export DESTINATION ${CMAKECONFIG_INSTALL_DIR} FILE QJSON${QJSON_SUFFIX}Targets.cmake)
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
# figure out the relative path from the installed Config.cmake file to the install prefix (which may be at
|
|
Rex Dieter |
c5a9d58 |
# runtime different from the chosen CMAKE_INSTALL_PREFIX if under Windows the package was installed anywhere)
|
|
Rex Dieter |
0dba7d1 |
@@ -115,13 +116,13 @@ file(RELATIVE_PATH relInstallDir ${CMAKE_INSTALL_PREFIX}/${CMAKECONFIG_INSTALL_D
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
# cmake-modules
|
|
Rex Dieter |
c5a9d58 |
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/QJSONConfig.cmake.in
|
|
Rex Dieter |
c5a9d58 |
- ${CMAKE_CURRENT_BINARY_DIR}/QJSONConfig.cmake
|
|
Rex Dieter |
c5a9d58 |
+ ${CMAKE_CURRENT_BINARY_DIR}/QJSON${QJSON_SUFFIX}Config.cmake
|
|
Rex Dieter |
c5a9d58 |
@ONLY)
|
|
Rex Dieter |
c5a9d58 |
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/QJSONConfigVersion.cmake.in
|
|
Rex Dieter |
c5a9d58 |
- ${CMAKE_CURRENT_BINARY_DIR}/QJSONConfigVersion.cmake
|
|
Rex Dieter |
c5a9d58 |
+ ${CMAKE_CURRENT_BINARY_DIR}/QJSON${QJSON_SUFFIX}ConfigVersion.cmake
|
|
Rex Dieter |
c5a9d58 |
@ONLY)
|
|
Rex Dieter |
c5a9d58 |
-INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/QJSONConfig.cmake
|
|
Rex Dieter |
c5a9d58 |
- ${CMAKE_CURRENT_BINARY_DIR}/QJSONConfigVersion.cmake
|
|
Rex Dieter |
c5a9d58 |
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/QJSON${QJSON_SUFFIX}Config.cmake
|
|
Rex Dieter |
c5a9d58 |
+ ${CMAKE_CURRENT_BINARY_DIR}/QJSON${QJSON_SUFFIX}ConfigVersion.cmake
|
|
Rex Dieter |
c5a9d58 |
DESTINATION "${CMAKECONFIG_INSTALL_DIR}")
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
ADD_CUSTOM_TARGET(uninstall
|
|
Rex Dieter |
0dba7d1 |
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
index df560a6..0ae7c40 100755
|
|
Rex Dieter |
0dba7d1 |
--- a/src/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
+++ b/src/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
@@ -30,36 +30,36 @@ if(WIN32 AND QJSON_BUILD_TESTS AND BUILD_SHARED_LIBS)
|
|
Rex Dieter |
c5a9d58 |
add_library(qjson_scanner STATIC json_scanner.cpp)
|
|
Rex Dieter |
c5a9d58 |
endif()
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
-add_library (qjson ${qjson_SRCS} ${qjson_MOC_SRCS} ${qjson_HEADERS})
|
|
Rex Dieter |
c5a9d58 |
+add_library (qjson${QJSON_SUFFIX} ${qjson_SRCS} ${qjson_MOC_SRCS} ${qjson_HEADERS})
|
|
Rex Dieter |
c5a9d58 |
IF (Qt5Core_FOUND)
|
|
Rex Dieter |
c5a9d58 |
- target_link_libraries( qjson ${Qt5Core_LIBRARIES})
|
|
Rex Dieter |
c5a9d58 |
+ target_link_libraries( qjson${QJSON_SUFFIX} ${Qt5Core_LIBRARIES})
|
|
Rex Dieter |
c5a9d58 |
ELSE()
|
|
Rex Dieter |
c5a9d58 |
- target_link_libraries( qjson ${QT_LIBRARIES})
|
|
Rex Dieter |
c5a9d58 |
+ target_link_libraries( qjson${QJSON_SUFFIX} ${QT_LIBRARIES})
|
|
Rex Dieter |
c5a9d58 |
ENDIF()
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
if(NOT ANDROID)
|
|
Rex Dieter |
c5a9d58 |
- set_target_properties(qjson PROPERTIES
|
|
Rex Dieter |
c5a9d58 |
+ set_target_properties(qjson${QJSON_SUFFIX} PROPERTIES
|
|
Rex Dieter |
c5a9d58 |
VERSION ${QJSON_LIB_MAJOR_VERSION}.${QJSON_LIB_MINOR_VERSION}.${QJSON_LIB_PATCH_VERSION}
|
|
Rex Dieter |
c5a9d58 |
SOVERSION ${QJSON_LIB_MAJOR_VERSION}
|
|
Rex Dieter |
c5a9d58 |
)
|
|
Rex Dieter |
c5a9d58 |
endif()
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
if(NOT BUILD_SHARED_LIBS)
|
|
Rex Dieter |
c5a9d58 |
- set_target_properties( qjson PROPERTIES COMPILE_DEFINITIONS "QJSON_STATIC")
|
|
Rex Dieter |
c5a9d58 |
+ set_target_properties( qjson${QJSON_SUFFIX} PROPERTIES COMPILE_DEFINITIONS "QJSON_STATIC")
|
|
Rex Dieter |
c5a9d58 |
endif()
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
-set_target_properties(qjson PROPERTIES
|
|
Rex Dieter |
c5a9d58 |
+set_target_properties(qjson${QJSON_SUFFIX} PROPERTIES
|
|
Rex Dieter |
c5a9d58 |
DEFINE_SYMBOL QJSON_MAKEDLL
|
|
Rex Dieter |
c5a9d58 |
PUBLIC_HEADER "${qjson_HEADERS}"
|
|
Rex Dieter |
c5a9d58 |
FRAMEWORK ${OSX_FRAMEWORK}
|
|
Rex Dieter |
c5a9d58 |
)
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
-INSTALL(TARGETS qjson EXPORT qjson-export
|
|
Rex Dieter |
c5a9d58 |
+INSTALL(TARGETS qjson${QJSON_SUFFIX} EXPORT qjson-export
|
|
Rex Dieter |
c5a9d58 |
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
|
|
Rex Dieter |
c5a9d58 |
RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
|
|
Rex Dieter |
c5a9d58 |
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
|
|
Rex Dieter |
c5a9d58 |
FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR}
|
|
Rex Dieter |
c5a9d58 |
- PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/qjson
|
|
Rex Dieter |
c5a9d58 |
+ PUBLIC_HEADER DESTINATION ${INCLUDE_INSTALL_DIR}/qjson${QJSON_SUFFIX}
|
|
Rex Dieter |
c5a9d58 |
)
|
|
Rex Dieter |
c5a9d58 |
|
|
Rex Dieter |
c5a9d58 |
if(MSVC)
|
|
Rex Dieter |
0dba7d1 |
diff --git a/tests/benchmarks/CMakeLists.txt b/tests/benchmarks/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
index 824b56e..9132309 100644
|
|
Rex Dieter |
0dba7d1 |
--- a/tests/benchmarks/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
+++ b/tests/benchmarks/CMakeLists.txt
|
|
Rex Dieter |
c5a9d58 |
@@ -27,7 +27,7 @@ FOREACH(test ${UNIT_TESTS})
|
|
Rex Dieter |
c5a9d58 |
${test}
|
|
Rex Dieter |
c5a9d58 |
${QT_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
${TEST_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
- qjson
|
|
Rex Dieter |
c5a9d58 |
+ qjson${QJSON_SUFFIX}
|
|
Rex Dieter |
c5a9d58 |
)
|
|
Rex Dieter |
c5a9d58 |
if (QJSON_TEST_OUTPUT STREQUAL "xml")
|
|
Rex Dieter |
c5a9d58 |
# produce XML output
|
|
Rex Dieter |
0dba7d1 |
diff --git a/tests/cmdline_tester/CMakeLists.txt b/tests/cmdline_tester/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
index c7cf4cd..12c72cf 100644
|
|
Rex Dieter |
0dba7d1 |
--- a/tests/cmdline_tester/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
+++ b/tests/cmdline_tester/CMakeLists.txt
|
|
Rex Dieter |
c5a9d58 |
@@ -31,5 +31,5 @@ TARGET_LINK_LIBRARIES(
|
|
Rex Dieter |
c5a9d58 |
cmdline_tester
|
|
Rex Dieter |
c5a9d58 |
${QT_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
${Qt5Widgets_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
- qjson
|
|
Rex Dieter |
c5a9d58 |
+ qjson${QJSON_SUFFIX}
|
|
Rex Dieter |
c5a9d58 |
)
|
|
Rex Dieter |
0dba7d1 |
diff --git a/tests/parser/CMakeLists.txt b/tests/parser/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
index bd86cee..b280a38 100644
|
|
Rex Dieter |
0dba7d1 |
--- a/tests/parser/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
+++ b/tests/parser/CMakeLists.txt
|
|
Rex Dieter |
c5a9d58 |
@@ -35,7 +35,7 @@ FOREACH(test ${UNIT_TESTS})
|
|
Rex Dieter |
c5a9d58 |
${test}
|
|
Rex Dieter |
c5a9d58 |
${QT_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
${TEST_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
- qjson
|
|
Rex Dieter |
c5a9d58 |
+ qjson${QJSON_SUFFIX}
|
|
Rex Dieter |
c5a9d58 |
)
|
|
Rex Dieter |
c5a9d58 |
if (QJSON_TEST_OUTPUT STREQUAL "xml")
|
|
Rex Dieter |
c5a9d58 |
# produce XML output
|
|
Rex Dieter |
0dba7d1 |
diff --git a/tests/qobjecthelper/CMakeLists.txt b/tests/qobjecthelper/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
index d1636e6..e474ffd 100644
|
|
Rex Dieter |
0dba7d1 |
--- a/tests/qobjecthelper/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
+++ b/tests/qobjecthelper/CMakeLists.txt
|
|
Rex Dieter |
c5a9d58 |
@@ -43,7 +43,7 @@ FOREACH(test ${UNIT_TESTS})
|
|
Rex Dieter |
c5a9d58 |
${test}
|
|
Rex Dieter |
c5a9d58 |
${QT_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
${TEST_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
- qjson
|
|
Rex Dieter |
c5a9d58 |
+ qjson${QJSON_SUFFIX}
|
|
Rex Dieter |
c5a9d58 |
qjson_test_support
|
|
Rex Dieter |
c5a9d58 |
)
|
|
Rex Dieter |
c5a9d58 |
if (QJSON_TEST_OUTPUT STREQUAL "xml")
|
|
Rex Dieter |
0dba7d1 |
diff --git a/tests/scanner/CMakeLists.txt b/tests/scanner/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
index 48c1c18..e263577 100644
|
|
Rex Dieter |
0dba7d1 |
--- a/tests/scanner/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
+++ b/tests/scanner/CMakeLists.txt
|
|
Rex Dieter |
c5a9d58 |
@@ -40,7 +40,7 @@ FOREACH(test ${UNIT_TESTS})
|
|
Rex Dieter |
c5a9d58 |
${test}
|
|
Rex Dieter |
c5a9d58 |
${QT_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
${TEST_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
- qjson
|
|
Rex Dieter |
c5a9d58 |
+ qjson${QJSON_SUFFIX}
|
|
Rex Dieter |
c5a9d58 |
${QJSON_SCANNER}
|
|
Rex Dieter |
c5a9d58 |
)
|
|
Rex Dieter |
c5a9d58 |
if (QJSON_TEST_OUTPUT STREQUAL "xml")
|
|
Rex Dieter |
0dba7d1 |
diff --git a/tests/serializer/CMakeLists.txt b/tests/serializer/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
index c3411bc..7222fc7 100644
|
|
Rex Dieter |
0dba7d1 |
--- a/tests/serializer/CMakeLists.txt
|
|
Rex Dieter |
0dba7d1 |
+++ b/tests/serializer/CMakeLists.txt
|
|
Rex Dieter |
c5a9d58 |
@@ -35,7 +35,7 @@ FOREACH(test ${UNIT_TESTS})
|
|
Rex Dieter |
c5a9d58 |
${test}
|
|
Rex Dieter |
c5a9d58 |
${QT_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
${TEST_LIBRARIES}
|
|
Rex Dieter |
c5a9d58 |
- qjson
|
|
Rex Dieter |
c5a9d58 |
+ qjson${QJSON_SUFFIX}
|
|
Rex Dieter |
c5a9d58 |
)
|
|
Rex Dieter |
c5a9d58 |
if (QJSON_TEST_OUTPUT STREQUAL "xml")
|
|
Rex Dieter |
c5a9d58 |
# produce XML output
|
|
Rex Dieter |
0dba7d1 |
--
|
|
Rex Dieter |
0dba7d1 |
2.5.0
|
|
Rex Dieter |
0dba7d1 |
|