-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathCMakeLists.txt
64 lines (48 loc) · 1.72 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
project(qtsparkle)
cmake_minimum_required(VERSION 2.8.12)
cmake_policy(SET CMP0020 NEW)
cmake_policy(SET CMP0043 NEW)
include(cmake/Translations.cmake)
option(BUILD_WITH_QT4 "Build qtsparkle with Qt 4" OFF)
option(BUILD_WITH_QT5 "Build qtsparkle with Qt 5" OFF)
option(BUILD_WITH_QT6 "Build qtsparkle with Qt 6" OFF)
if (NOT BUILD_WITH_QT4 AND NOT BUILD_WITH_QT5 AND NOT BUILD_WITH_QT6)
set(BUILD_WITH_QT5 ON)
endif()
option(BUILD_STATIC "Static build" OFF)
if(BUILD_WITH_QT4)
find_package(Qt4 REQUIRED QtCore QtGui QtNetwork QtXml)
add_definitions(${QT_DEFINITIONS})
include(${QT_USE_FILE})
macro(qt_add_resources)
qt4_add_resources(${ARGN})
endmacro()
set(QT_SUFFIX "")
message("- Building with Qt 4")
elseif(BUILD_WITH_QT5)
find_package(Qt5 REQUIRED COMPONENTS Core Network Widgets LinguistTools)
set(QT_LUPDATE_EXECUTABLE ${Qt5_LUPDATE_EXECUTABLE})
set(QT_LRELEASE_EXECUTABLE ${Qt5_LRELEASE_EXECUTABLE})
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()
set(QT_LIBRARIES Qt5::Core Qt5::Network Qt5::Widgets)
set(QT_SUFFIX "-qt5")
message("- Building with Qt 5")
elseif(BUILD_WITH_QT6)
find_package(Qt6 REQUIRED COMPONENTS Core Network Widgets LinguistTools)
set(QT_LUPDATE_EXECUTABLE Qt6::lupdate)
set(QT_LRELEASE_EXECUTABLE Qt6::lrelease)
macro(qt_add_resources)
qt6_add_resources(${ARGN})
endmacro()
set(QT_LIBRARIES Qt6::Core Qt6::Network Qt6::Widgets)
set(QT_SUFFIX "-qt6")
message("- Building with Qt 6")
else()
message(FATAL_ERROR "You need to set either BUILD_WITH_QT4, BUILD_WITH_QT5 or BUILD_WITH_QT6.")
endif()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
add_subdirectory(src)
add_subdirectory(exampleapp)