]> git.mar77i.info Git - bigintmandel/blob - CMakeLists.txt
make zoom_factor part of MandelSettings
[bigintmandel] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.5)
2
3 project(bigintmandel VERSION 0.1 LANGUAGES CXX)
4
5 set(CMAKE_AUTOUIC ON)
6 set(CMAKE_AUTOMOC ON)
7 set(CMAKE_AUTORCC ON)
8
9 set(CMAKE_CXX_STANDARD 11)
10 set(CMAKE_CXX_STANDARD_REQUIRED ON)
11
12 find_package(QT NAMES Qt6 REQUIRED COMPONENTS Widgets Concurrent)
13 find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Concurrent)
14
15 set(PROJECT_SOURCES
16 main.cpp
17 bigintmandelwidget.cpp
18 bigintmandelwidget.h
19 mandel.cpp
20 mandel.h
21 settingswidget.cpp
22 settingswidget.h
23 menubar.cpp
24 menubar.h
25 mandellabel.cpp
26 mandellabel.h
27 )
28
29 if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
30 qt_add_executable(bigintmandel
31 MANUAL_FINALIZATION
32 ${PROJECT_SOURCES}
33 )
34 # Define target properties for Android with Qt 6 as:
35 # set_property(TARGET bigintmandel APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
36 # ${CMAKE_CURRENT_SOURCE_DIR}/android)
37 # For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
38 else()
39 if(ANDROID)
40 add_library(bigintmandel SHARED
41 ${PROJECT_SOURCES}
42 )
43 # Define properties for Android with Qt 5 after find_package() calls as:
44 # set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
45 else()
46 add_executable(bigintmandel
47 ${PROJECT_SOURCES}
48 )
49 endif()
50 endif()
51
52 target_link_libraries(
53 bigintmandel
54 PRIVATE
55 Qt${QT_VERSION_MAJOR}::Widgets
56 Qt${QT_VERSION_MAJOR}::Concurrent
57 gmp
58 )
59
60 # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
61 # If you are developing for iOS or macOS you should consider setting an
62 # explicit, fixed bundle identifier manually though.
63 if(${QT_VERSION} VERSION_LESS 6.1.0)
64 set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.bigintmandel)
65 endif()
66 set_target_properties(bigintmandel PROPERTIES
67 ${BUNDLE_ID_OPTION}
68 MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
69 MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
70 MACOSX_BUNDLE TRUE
71 WIN32_EXECUTABLE TRUE
72 )
73
74 include(GNUInstallDirs)
75 install(TARGETS bigintmandel
76 BUNDLE DESTINATION .
77 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
78 RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
79 )
80
81 if(QT_VERSION_MAJOR EQUAL 6)
82 qt_finalize_executable(bigintmandel)
83 endif()