-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
94 lines (75 loc) · 2.74 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
cmake_minimum_required(VERSION 3.5)
project(Fractals VERSION 0.1 LANGUAGES CXX)
#set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# compiler flags
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -ggdb")
configure_file(src/FractalsConfig.h.in FractalsConfig.h)
# QtCreator supports the following variables for Android, which are identical to qmake Android variables.
# Check https://doc.qt.io/qt/deployment-android.html for more information.
# They need to be set before the find_package( ...) calls below.
#if(ANDROID)
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
# if (ANDROID_ABI STREQUAL "armeabi-v7a")
# set(ANDROID_EXTRA_LIBS
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so)
# endif()
#endif()
find_package(QT NAMES Qt6 Qt5 COMPONENTS Widgets REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Widgets REQUIRED)
set(PROJECT_SOURCES
src/main.cpp
src/GUI/mainwindow.cpp
src/GUI/mainwindow.h
src/GUI/mainwindow.ui
src/Logic/fractal.h
src/Logic/constants.h
src/Logic/fractal.cpp
src/Logic/generators.h
src/Logic/generators.cpp
src/Logic/colorPalette.cpp
src/Logic/colorPalette.h
src/Logic/palettes.h
src/OpenGL/oglwidget.h src/OpenGL/oglwidget.cpp
src/GUI/combobox_fractals.h src/GUI/combobox_fractals.cpp
src/GUI/combobox_palettes.h src/GUI/combobox_palettes.cpp
src/GUI/label_pos.h src/GUI/label_pos.cpp
src/Logic/fractalsSupplier.h)
# adding boost dirs
FIND_PACKAGE( Boost 1.71 COMPONENTS program_options REQUIRED )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
include_directories("." "./src" "./src/Logic" "./src/OpenGL" "src/GUI")
find_library(GL_LIB GL)
find_library(GLU_LIB GLU)
find_library(THREADS_LIB pthread)
link_libraries("${GL_LIB}" "${GLU_LIB}" "${Boost_LIBRARIES}" "${THREADS_LIB}")
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(Fractals
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
else()
if(ANDROID)
add_library(Fractals SHARED
${PROJECT_SOURCES}
)
else()
add_executable(Fractals
${PROJECT_SOURCES}
)
endif()
endif()
target_link_libraries(Fractals PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
set_target_properties(Fractals PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
)
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(Fractals)
endif()