-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
134 lines (124 loc) · 4.01 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# Copyright 2022-present Contributors to the jobman project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/mikaelsundell/jobman
cmake_minimum_required( VERSION 3.27 )
set( project_name "Jobman" )
project( ${project_name} )
# packages
set (qt6_modules Core Concurrent Gui Widgets)
find_package(Qt6 COMPONENTS ${qt6_modules} CONFIG REQUIRED)
set (CMAKE_AUTOMOC ON)
set (CMAKE_AUTORCC ON)
set (CMAKE_AUTOUIC ON)
set (CMAKE_POSITION_INDEPENDENT_CODE ON)
find_package( Lcms2 REQUIRED )
# sourcesld
set (app_sources
clickfilter.h
clickfilter.cpp
jobman.h
jobman.cpp
urlfilter.h
urlfilter.cpp
error.h
error.cpp
filedrop.h
filedrop.cpp
icctransform.h
icctransform.cpp
job.h
job.cpp
jobtree.h
jobtree.cpp
listwidget.h
listwidget.cpp
mac.h
mac.mm
main.cpp
monitor.h
monitor.cpp
options.h
options.cpp
preferences.h
preferences.cpp
preset.h
preset.cpp
process.h
process.cpp
queue.h
queue.cpp
question.h
question.cpp
about.ui
jobman.ui
error.ui
monitor.ui
question.ui
preferences.ui
progressbar.ui
options.ui
jobman.qrc
)
# resources
file( GLOB app_resources
"resources/*.icns"
"resources/*.icc"
"resources/*.css"
"resources/App*.png"
)
# presets
file( GLOB app_presets
"presets/*.json"
)
# bundle
set (bundle_sources
"${CMAKE_SOURCE_DIR}/resources/MacOSXBundle.plist.in"
)
# source groups
source_group("ICC Files" FILES ${app_iccprofiles})
source_group("Resouce Files" FILES ${app_resources})
source_group("Preset Files" FILES ${app_presets})
if (APPLE)
set (MACOSX_BUNDLE_GUI_IDENTIFIER "com.github.mikaelsundell.jobman")
set (MACOSX_BUNDLE_EXECUTABLE_NAME ${project_name})
set (MACOSX_BUNDLE_INFO_STRING ${project_name})
set (MACOSX_BUNDLE_BUNDLE_NAME ${project_name})
set (MACOSX_BUNDLE_ICON_FILE AppIcon.icns)
set (MACOSX_BUNDLE_LONG_VERSION_STRING "1.0.6")
set (MACOSX_BUNDLE_SHORT_VERSION_STRING "1.0")
set (MACOSX_BUNDLE_BUNDLE_VERSION ${MACOSX_BUNDLE_LONG_VERSION_STRING})
set (MACOSX_BUNDLE_COPYRIGHT "Copyright 2022-present Contributors to the ${project_name} project")
set (MACOSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET})
set (CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "-o linker-signed")
set_source_files_properties(${app_resources} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set_source_files_properties(${app_presets} PROPERTIES MACOSX_PACKAGE_LOCATION "Presets")
add_executable (${project_name} MACOSX_BUNDLE ${app_sources} ${app_resources} ${app_presets})
# definitions
add_definitions(-DMACOSX_BUNDLE_BUNDLE_NAME="${MACOSX_BUNDLE_BUNDLE_NAME}")
add_definitions(-DMACOSX_BUNDLE_GUI_IDENTIFIER="${MACOSX_BUNDLE_GUI_IDENTIFIER}")
add_definitions(-DMACOSX_BUNDLE_COPYRIGHT="${MACOSX_BUNDLE_COPYRIGHT}")
add_definitions(-DMACOSX_BUNDLE_LONG_VERSION_STRING="${MACOSX_BUNDLE_LONG_VERSION_STRING}")
add_definitions(-DGITHUBURL="https://github.com/mikaelsundell/jobman")
set_target_properties(${project_name} PROPERTIES
XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER "${MACOSX_BUNDLE_GUI_IDENTIFIER}"
XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET}
MACOSX_BUNDLE_INFO_PLIST ${bundle_sources}
)
if (NOT PROVISIONING_PROFILE STREQUAL "")
set_target_properties(${project_name} PROPERTIES
XCODE_ATTRIBUTE_PROVISIONING_PROFILE_SPECIFIER "${PROVISIONING_PROFILE}"
)
endif()
set_target_properties(${project_name} PROPERTIES
OUTPUT_NAME ${project_name}
)
target_compile_options (${project_name} PRIVATE -Wno-deprecated-register)
target_include_directories (${project_name} PRIVATE ${LCMS2_INCLUDE_DIR})
target_link_libraries (${project_name}
Qt6::Core Qt6::Concurrent Qt6::Gui Qt6::Widgets
${LCMS2_LIBRARY}
"-framework CoreFoundation"
"-framework AppKit")
else ()
message (WARNING "${project_name} is a Mac program, will not be built.")
endif ()