[Kst] branches/work/kst/portto4/kst/cmake

Peter Kümmel syntheticpp at gmx.net
Sun Oct 7 15:55:41 UTC 2012


SVN commit 1319581 by kuemmel:

simplify Qt5 detection

 M  +6 -2      CMakeLists.txt  
 M  +1 -1      src/libkstapp/CMakeLists.txt  
 M  +1 -0      travis.sh  


--- branches/work/kst/portto4/kst/cmake/CMakeLists.txt #1319580:1319581
@@ -41,7 +41,7 @@
 kst_option(string ""  all python_prefix     "Path for installing python bindings")
 kst_option(string OFF all cross             "Cross-compile on Linux for Windows")
 kst_option(string ""  all qt4               "Use cross compiled Qt4 at given path")
-kst_option(string ""  all qt5               "Use Qt5 at given path")
+kst_option(string ""  all qt5               "Use Qt5")
 kst_option(bool   ON  all qt5base_only      "Only use Qt5 features available in qtbase")
 kst_option(bool   ON  all opengl            "Use OpenGL")
 
@@ -130,11 +130,15 @@
 if (kst_qt5)
 	# http://doc-snapshot.qt-project.org/5.0/cmake-manual.html
 	cmake_minimum_required(VERSION 2.8.9)
-	set(CMAKE_PREFIX_PATH ${kst_qt5})
 	macro(use_qt5lib qt5lib)
 		find_package(${qt5lib} REQUIRED)
 		include_directories(${${qt5lib}_INCLUDE_DIRS})
 	endmacro()
+	use_qt5lib(Qt5Core)
+	get_target_property(qmakebin Qt5::qmake IMPORTED_LOCATION)
+	get_filename_component(QT_BINARY_DIR ${qmakebin} PATH)
+	message(STATUS "Using Qt5 from ${QT_BINARY_DIR}")
+	set(CMAKE_PREFIX_PATH ${QT_BINARY_DIR}/..)
 	use_qt5lib(Qt5Widgets)
 	use_qt5lib(Qt5Network)
 	use_qt5lib(Qt5Xml)
--- branches/work/kst/portto4/kst/cmake/src/libkstapp/CMakeLists.txt #1319580:1319581
@@ -1,6 +1,6 @@
 kst_init(${kst_binary_name} app)
 
-if(kst_qt5 AND kst_qt5base_only)
+if(kst_qt5)
 	kst_files_ignore(svgitem)
 	add_definitions(-DKST_NO_SVG)
 	#add_definitions(-DKST_NO_PRINTER)
--- branches/work/kst/portto4/kst/cmake/travis.sh #1319580:1319581
@@ -90,6 +90,7 @@
     readelf -h  /opt/$qtver/bin/qmake
     /opt/$qtver/bin/qmake -query
     checkExitCode
+    export PATH=/opt/$qtver/bin:$PATH
 fi
 
 #


More information about the Kst mailing list