Commit c20b5d3c authored by Andreas Traczyk's avatar Andreas Traczyk

cmake: require qt version

This forces a minimum qt version set when we're building the qt
client.

Also use the runtime linker search paths for the installed binary.

Gitlab: #581
Change-Id: I3f33dece350244624ba8f777d587682a36769730
parent 3692c64e
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
CMAKE_MINIMUM_REQUIRED(VERSION 3.5.1)
IF(POLICY CMP0022)
CMAKE_POLICY(SET CMP0022 NEW)
......@@ -73,13 +73,24 @@ SET(CMAKE_AUTOMOC TRUE)
SET(LOCAL_CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/")
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LOCAL_CMAKE_MODULE_PATH})
SET(QT5_MODULE_PATH ${QT5_PATH}/lib/cmake)
FIND_PACKAGE(Ring REQUIRED)
FIND_PACKAGE(Qt5Core REQUIRED)
FIND_PACKAGE(Qt5LinguistTools) # translations
FIND_PACKAGE(Qt5Sql REQUIRED)
FIND_PACKAGE(Qt5Gui REQUIRED)
if (${QT_MIN_VER} MATCHES "5.15")
message(STATUS "Using custom Qt version")
find_package(Qt5 ${QT_MIN_VER} REQUIRED
COMPONENTS Core DBus Sql Gui
PATHS ${QT5_PATH} NO_DEFAULT_PATH)
# Linguist tools is not required.
find_package(Qt5 ${QT_MIN_VER}
COMPONENTS LinguistTools
PATHS ${QT5_PATH} NO_DEFAULT_PATH)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)
else()
find_package(Qt5 REQUIRED
COMPONENTS Core DBus Sql Gui)
# Linguist tools is not required.
find_package(Qt5LinguistTools)
endif()
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
MESSAGE(STATUS "PLUGIN enabled")
......
......@@ -12,7 +12,7 @@ import re
# vs help
win_sdk_default = '10.0.16299.0'
win_toolset_default = 'v141'
win_toolset_default = 'v142'
vs_where_path = os.path.join(
os.environ['ProgramFiles(x86)'], 'Microsoft Visual Studio', 'Installer', 'vswhere.exe'
......@@ -135,9 +135,9 @@ def generate(force, qtver, sdk, toolset, arch):
qtFolderDir = "msvc2017_64"
qtverSplit = qtver.split('.')
if((int(qtverSplit[0]) >= 6) or((int(qtverSplit[0]) == 5) and (int(qtverSplit[1]) >= 15))):
if((int(qtverSplit[0]) >= 6) or ((int(qtverSplit[0]) == 5) and (int(qtverSplit[1]) >= 15))):
qtFolderDir = "msvc2019_64"
qt_cmake_dir = qt_dir + '\\'+ qtFolderDir +'\\lib\\cmake\\'
qt_cmake_dir = qt_dir + '\\' + qtFolderDir + '\\lib\\cmake\\'
cmake_options = [
'-DQt5Core_DIR=' + qt_cmake_dir + 'Qt5Core',
'-DQt5Sql_DIR=' + qt_cmake_dir + 'Qt5Sql',
......@@ -224,7 +224,7 @@ def parse_args():
'-p', '--purge', action='store_true',
help='Purges the build directory')
ap.add_argument(
'-q', '--qtver', default='5.9.4',
'-q', '--qtver', default='5.15.0',
help='Sets the Qt version to build with')
ap.add_argument(
'-g', '--gen', action='store_true',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment