Rex Dieter e5f144c
From 3ff5899891d83d815c7fb100f4f4e9b32194604c Mon Sep 17 00:00:00 2001
Rex Dieter e5f144c
From: Rex Dieter <rdieter@math.unl.edu>
Rex Dieter e5f144c
Date: Tue, 20 Oct 2015 12:12:50 -0500
Rex Dieter e5f144c
Subject: [PATCH 10/10] parallel installable prison-qt5
Rex Dieter e5f144c
Rex Dieter 21a7091
Make Qt4 and Qt5 prison builds fully parallel-installable
Rex Dieter 21a7091
Rex Dieter 21a7091
REVIEW: 125944
Rex Dieter 21a7091
Rex Dieter e5f144c
---
Rex Dieter e5f144c
 CMakeLists.txt            |  2 ++
Rex Dieter e5f144c
 lib/prison/CMakeLists.txt | 28 ++++++++++++----------------
Rex Dieter e5f144c
 testapp/CMakeLists.txt    |  2 +-
Rex Dieter e5f144c
 tools/CMakeLists.txt      |  2 +-
Rex Dieter e5f144c
 4 files changed, 16 insertions(+), 18 deletions(-)
Rex Dieter e5f144c
Rex Dieter e5f144c
diff --git a/CMakeLists.txt b/CMakeLists.txt
Rex Dieter e5f144c
index ca39df5..8aec35c 100644
Rex Dieter e5f144c
--- a/CMakeLists.txt
Rex Dieter e5f144c
+++ b/CMakeLists.txt
Rex Dieter e5f144c
@@ -27,6 +27,8 @@ if(QT5_BUILD)
Rex Dieter e5f144c
   find_package(Qt5Widgets REQUIRED)
Rex Dieter e5f144c
   find_package(Qt5Test REQUIRED)
Rex Dieter e5f144c
 
Rex Dieter e5f144c
+  set(PRISON_SUFFIX "-qt5")
Rex Dieter e5f144c
+
Rex Dieter e5f144c
   include("cmake/modules/ECMQt4To5Porting.cmake")
Rex Dieter e5f144c
   include_directories(${QT_INCLUDES}) # TODO: Port away from this.
Rex Dieter e5f144c
 
Rex Dieter e5f144c
diff --git a/lib/prison/CMakeLists.txt b/lib/prison/CMakeLists.txt
Rex Dieter e5f144c
index 57f350a..0384375 100644
Rex Dieter e5f144c
--- a/lib/prison/CMakeLists.txt
Rex Dieter e5f144c
+++ b/lib/prison/CMakeLists.txt
Rex Dieter e5f144c
@@ -1,10 +1,6 @@
Rex Dieter e5f144c
 include(CMakePackageConfigHelpers)
Rex Dieter e5f144c
 
Rex Dieter e5f144c
-if(QT5_BUILD)
Rex Dieter e5f144c
-   set(PRISON_VERSION_MAJOR "1")
Rex Dieter e5f144c
-else()
Rex Dieter e5f144c
-   set(PRISON_VERSION_MAJOR "0")
Rex Dieter e5f144c
-endif()
Rex Dieter e5f144c
+set(PRISON_VERSION_MAJOR "0")
Rex Dieter e5f144c
 set(PRISON_VERSION_MINOR "2")
Rex Dieter e5f144c
 set(PRISON_VERSION_PATCH "0")
Rex Dieter e5f144c
 
Rex Dieter e5f144c
@@ -25,10 +21,10 @@ SET(    prison_SRC
Rex Dieter e5f144c
         qrcodebarcode.cpp
Rex Dieter e5f144c
         )
Rex Dieter e5f144c
 
Rex Dieter e5f144c
-add_library(prison SHARED ${prison_SRC})
Rex Dieter e5f144c
-target_link_libraries(prison ${DMTX_LIBRARIES} ${QRENCODE_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
Rex Dieter e5f144c
+add_library(prison${PRISON_SUFFIX} SHARED ${prison_SRC})
Rex Dieter e5f144c
+target_link_libraries(prison${PRISON_SUFFIX} ${DMTX_LIBRARIES} ${QRENCODE_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
Rex Dieter e5f144c
 
Rex Dieter e5f144c
-set_target_properties(prison PROPERTIES VERSION "${PRISON_VERSION_STRING}" SOVERSION "${PRISON_VERSION_MAJOR}" LINK_INTERFACE_LIBRARIES "" DEFINE_SYMBOL BUILDING_PRISON)
Rex Dieter e5f144c
+set_target_properties(prison${PRISON_SUFFIX} PROPERTIES VERSION "${PRISON_VERSION_STRING}" SOVERSION "${PRISON_VERSION_MAJOR}" LINK_INTERFACE_LIBRARIES "" DEFINE_SYMBOL BUILDING_PRISON)
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
Rex Dieter e5f144c
 
Rex Dieter e5f144c
@@ -47,7 +43,7 @@ if (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
Rex Dieter e5f144c
 endif (CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 if(QT5_BUILD)
Rex Dieter e5f144c
-  install(TARGETS prison ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
Rex Dieter e5f144c
+  install(TARGETS prison${PRISON_SUFFIX} ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})
Rex Dieter e5f144c
 else()
Rex Dieter e5f144c
   install( TARGETS prison DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} )
Rex Dieter e5f144c
 endif()
Rex Dieter e5f144c
@@ -68,35 +64,35 @@ install( FILES
Rex Dieter e5f144c
          qrcodebarcode.h
Rex Dieter e5f144c
          QRCodeBarcode
Rex Dieter e5f144c
          prison_export.h
Rex Dieter e5f144c
-         DESTINATION ${CMAKE_INSTALL_PREFIX}/include/prison COMPONENT devel
Rex Dieter e5f144c
+         DESTINATION ${CMAKE_INSTALL_PREFIX}/include/prison${PRISON_SUFFIX} COMPONENT devel
Rex Dieter e5f144c
          )
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 set(INCLUDE_DIRECTORY ${CMAKE_INSTALL_PREFIX}/include)
Rex Dieter e5f144c
-get_target_property(LIB_OUT_NAME prison LOCATION)
Rex Dieter e5f144c
+get_target_property(LIB_OUT_NAME prison${PRISON_SUFFIX} LOCATION)
Rex Dieter e5f144c
 get_filename_component(LIB_OUT_NAME ${LIB_OUT_NAME} NAME)
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 if(QT5_BUILD)
Rex Dieter e5f144c
   set(LIBPATH ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
Rex Dieter e5f144c
-  set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Prison")
Rex Dieter e5f144c
+  set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/Prison${PRISON_SUFFIX}")
Rex Dieter e5f144c
 else()
Rex Dieter e5f144c
   set(LIBPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
Rex Dieter e5f144c
   set(CMAKECONFIG_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/cmake/Prison")
Rex Dieter e5f144c
 endif()
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 configure_file(
Rex Dieter e5f144c
-   PrisonConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PrisonConfig.cmake @ONLY
Rex Dieter e5f144c
+   PrisonConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/Prison${PRISON_SUFFIX}Config.cmake @ONLY
Rex Dieter e5f144c
 )
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 # this file is used by to check if the installed version can be used.
Rex Dieter e5f144c
-write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/PrisonConfigVersion.cmake
Rex Dieter e5f144c
+write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/Prison${PRISON_SUFFIX}ConfigVersion.cmake
Rex Dieter e5f144c
                                  VERSION "${PRISON_VERSION_STRING}"
Rex Dieter e5f144c
                                  COMPATIBILITY SameMajorVersion
Rex Dieter e5f144c
                                 )
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 install( FILES
Rex Dieter e5f144c
-         ${CMAKE_CURRENT_BINARY_DIR}/PrisonConfig.cmake
Rex Dieter e5f144c
-         ${CMAKE_CURRENT_BINARY_DIR}/PrisonConfigVersion.cmake
Rex Dieter e5f144c
+         ${CMAKE_CURRENT_BINARY_DIR}/Prison${PRISON_SUFFIX}Config.cmake
Rex Dieter e5f144c
+         ${CMAKE_CURRENT_BINARY_DIR}/Prison${PRISON_SUFFIX}ConfigVersion.cmake
Rex Dieter e5f144c
 	 DESTINATION ${CMAKECONFIG_INSTALL_DIR}
Rex Dieter e5f144c
 )
Rex Dieter e5f144c
 
Rex Dieter e5f144c
diff --git a/testapp/CMakeLists.txt b/testapp/CMakeLists.txt
Rex Dieter e5f144c
index 95d3403..f1f5450 100644
Rex Dieter e5f144c
--- a/testapp/CMakeLists.txt
Rex Dieter e5f144c
+++ b/testapp/CMakeLists.txt
Rex Dieter e5f144c
@@ -1,4 +1,4 @@
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 set(prison_SRCS prison.cpp main.cpp)
Rex Dieter e5f144c
 add_executable(test-prison ${prison_SRCS})
Rex Dieter e5f144c
-target_link_libraries(test-prison ${QT_QTGUI_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} prison)
Rex Dieter e5f144c
+target_link_libraries(test-prison ${QT_QTGUI_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} prison${PRISON_SUFFIX})
Rex Dieter e5f144c
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
Rex Dieter e5f144c
index ea5132e..8f0423e 100644
Rex Dieter e5f144c
--- a/tools/CMakeLists.txt
Rex Dieter e5f144c
+++ b/tools/CMakeLists.txt
Rex Dieter e5f144c
@@ -2,4 +2,4 @@
Rex Dieter e5f144c
 #find_package(Qt4 COMPONENTS QtGui QtCore REQUIRED)
Rex Dieter e5f144c
 
Rex Dieter e5f144c
 add_executable(prison-datamatrix prison-datamatrix.cpp)
Rex Dieter e5f144c
-target_link_libraries(prison-datamatrix prison ${QT_QTGUI_LIBRARIES} ${QT_QTCORE_LIBRARY})
Rex Dieter e5f144c
+target_link_libraries(prison-datamatrix prison${PRISON_SUFFIX} ${QT_QTGUI_LIBRARIES} ${QT_QTCORE_LIBRARY})
Rex Dieter e5f144c
-- 
Rex Dieter e5f144c
2.5.0
Rex Dieter e5f144c