-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
executable file
·507 lines (437 loc) · 19.6 KB
/
CMakeLists.txt
File metadata and controls
executable file
·507 lines (437 loc) · 19.6 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
#############################################################
#
# On Windows, define the following environnemental variables before running:
#
# - OGRE_HOME (C:\OgreSDK)
# - CMAKE_PREFIX_PATH (to Qt <version>\<compiler>\lib\cmake folder)
#
##############################################################
# Versions
##############################################################
cmake_minimum_required(VERSION 3.24.0)
cmake_policy(SET CMP0005 NEW)
cmake_policy(SET CMP0048 NEW) # manages project version
project(QtMeshEditor VERSION 2.29.1 LANGUAGES C CXX)
message(STATUS "Building QtMeshEditor version ${PROJECT_VERSION}")
set(QTMESHEDITOR_VERSION_STRING "\"${PROJECT_VERSION}\"")
if(WIN32 OR APPLE)
set(PLUGIN_DIR "../")
endif()
add_definitions( -DQTMESHEDITOR_VERSION=${QTMESHEDITOR_VERSION_STRING} )
# Public QtMesh Cloud web URL (used by CLI promo + any future link-outs).
# Override with -DQTMESH_CLOUD_WEB_URL=https://... for self-hosted instances.
set(QTMESH_CLOUD_WEB_URL "https://qtmesh.dev" CACHE STRING
"QtMesh Cloud web UI base URL (no trailing slash)")
# Normalize: strip a single trailing slash so callers can paste a copied URL
# without breaking string concatenation downstream.
string(REGEX REPLACE "/+$" "" QTMESH_CLOUD_WEB_URL "${QTMESH_CLOUD_WEB_URL}")
add_definitions(-DQTMESH_CLOUD_WEB_URL="${QTMESH_CLOUD_WEB_URL}")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
##############################################################
# Configuring CMake
##############################################################
if(WIN32)
cmake_policy(SET CMP0020 NEW) # to avoid cmake warning
endif()
enable_language(CXX)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Building directories
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "debug")
MESSAGE("DEBUG COMPILATION")
ADD_DEFINITIONS("-DDEBUG")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib-debug)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib-debug)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/debug)
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/debug)
set(BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include_d)
else()
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
ADD_DEFINITIONS(-DQT_NO_DEBUG -DQT_NO_DEBUG_OUTPUT -DQT_NO_WARNING_OUTPUT)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(BUILD_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
endif()
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
##############################################################
# Searching Qt dependencies
##############################################################
# On newer macOS (11+), AGL framework is deprecated and has no actual library.
# Create a stub AGL.framework for linking purposes
if(APPLE)
set(AGL_STUB_DIR "${CMAKE_BINARY_DIR}/AGL_stub")
set(AGL_FW_DIR "${AGL_STUB_DIR}/AGL.framework")
set(AGL_FW_LIB "${AGL_FW_DIR}/Versions/A/AGL")
if(NOT EXISTS "${AGL_FW_LIB}")
file(MAKE_DIRECTORY "${AGL_FW_DIR}/Versions/A")
file(WRITE "${AGL_STUB_DIR}/agl_stub.c" "void __agl_stub_placeholder(void) {}")
# Build for arm64 since that's what modern macOS uses
execute_process(
COMMAND clang -arch arm64 -dynamiclib
-o "${AGL_FW_LIB}"
"${AGL_STUB_DIR}/agl_stub.c"
-install_name "/System/Library/Frameworks/AGL.framework/Versions/A/AGL"
-current_version 1.0.0 -compatibility_version 1.0.0
WORKING_DIRECTORY "${AGL_STUB_DIR}"
)
# Create symlinks
execute_process(COMMAND ln -sf A "${AGL_FW_DIR}/Versions/Current")
execute_process(COMMAND ln -sf Versions/Current/AGL "${AGL_FW_DIR}/AGL")
endif()
# Add our stub framework directory to the framework search path
link_directories("${AGL_STUB_DIR}")
set(CMAKE_FRAMEWORK_PATH "${AGL_STUB_DIR}" ${CMAKE_FRAMEWORK_PATH})
endif()
#Find Qt Packages
find_package(QT NAMES Qt6)
find_package(Qt6 REQUIRED COMPONENTS Core Widgets Gui QuickWidgets Quick Qml QmlModels QmlMeta Test Network QuickControls2)
message("Found Qt (${QT_VERSION_MAJOR})")
SET (QTLIBLIST
Qt${QT_VERSION_MAJOR}Gui
Qt${QT_VERSION_MAJOR}Core
Qt${QT_VERSION_MAJOR}Widgets
Qt${QT_VERSION_MAJOR}QuickWidgets
Qt${QT_VERSION_MAJOR}Quick
Qt${QT_VERSION_MAJOR}Qml
Qt${QT_VERSION_MAJOR}QmlModels
Qt${QT_VERSION_MAJOR}QmlWorkerScript
Qt${QT_VERSION_MAJOR}Network
Qt${QT_VERSION_MAJOR}OpenGL
Qt${QT_VERSION_MAJOR}QmlMeta
Qt${QT_VERSION_MAJOR}QuickControls2
Qt${QT_VERSION_MAJOR}QuickTemplates2
)
FOREACH(qtlib ${QTLIBLIST})
include_directories(${${qtlib}_INCLUDE_DIRS})
ENDFOREACH(qtlib)
#set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/;${CMAKE_MODULE_PATH}")
##############################################################
# googletest
##############################################################
option(BUILD_TESTS "Build the unity tests" OFF)
if(BUILD_TESTS)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/f8d7d77c06936315286eb55f8de22cd23c188571.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
# Include Google Test headers
include_directories(
${gtest_SOURCE_DIR}/include
${gtest_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/src
)
enable_testing()
# Add the test
add_test(NAME UnitTests COMMAND UnitTests)
include(GoogleTest)
endif()
##############################################################
# llama.cpp for local LLM inference
##############################################################
option(ENABLE_LOCAL_LLM "Enable local LLM inference with llama.cpp" ON)
if(ENABLE_LOCAL_LLM)
include(FetchContent)
# Configure llama.cpp build options
set(LLAMA_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(LLAMA_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(LLAMA_BUILD_SERVER OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
# Enable Metal on macOS for GPU acceleration
if(APPLE)
set(GGML_METAL ON CACHE BOOL "" FORCE)
set(GGML_METAL_EMBED_LIBRARY ON CACHE BOOL "" FORCE)
message(STATUS "Enabling Metal acceleration for llama.cpp on macOS")
endif()
# Enable CUDA on systems with NVIDIA GPUs
if(CMAKE_CUDA_COMPILER OR DEFINED ENV{CUDA_PATH})
set(GGML_CUDA ON CACHE BOOL "" FORCE)
message(STATUS "Enabling CUDA acceleration for llama.cpp")
endif()
# Disable native optimizations for cross-platform compatibility
set(GGML_NATIVE OFF CACHE BOOL "" FORCE)
# Enable CUDA for NVIDIA GPUs (much faster and avoids CPU compatibility issues)
find_package(CUDAToolkit QUIET)
if(CUDAToolkit_FOUND)
set(GGML_CUDA ON CACHE BOOL "" FORCE)
message(STATUS "CUDA found - enabling GPU acceleration for llama.cpp")
endif()
# For CPU fallback: disable AVX2/FMA for older CPUs (pre-Haswell compatibility)
set(GGML_AVX2 OFF CACHE BOOL "" FORCE)
set(GGML_FMA OFF CACHE BOOL "" FORCE)
set(GGML_BMI2 OFF CACHE BOOL "" FORCE)
# On Windows with MinGW, disable CPU backend to avoid SDK compatibility issues
if(WIN32 AND MINGW)
set(GGML_CPU OFF CACHE BOOL "" FORCE)
message(STATUS "Disabling CPU backend on MinGW due to SDK compatibility")
endif()
FetchContent_Declare(
llama_cpp
GIT_REPOSITORY https://github.com/ggerganov/llama.cpp.git
GIT_TAG master
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(llama_cpp)
# Include llama.cpp headers
include_directories(
${llama_cpp_SOURCE_DIR}/include
${llama_cpp_SOURCE_DIR}/ggml/include
)
add_definitions(-DENABLE_LOCAL_LLM)
message(STATUS "Local LLM support enabled with llama.cpp")
endif()
##############################################################
# stable-diffusion.cpp for AI texture generation
##############################################################
option(ENABLE_STABLE_DIFFUSION "Enable AI texture generation with stable-diffusion.cpp" OFF)
if(ENABLE_STABLE_DIFFUSION)
include(FetchContent)
# Configure stable-diffusion.cpp build options
set(SD_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SD_BUILD_SERVER OFF CACHE BOOL "" FORCE)
# Enable Metal on macOS for GPU acceleration
if(APPLE)
set(SD_METAL ON CACHE BOOL "" FORCE)
message(STATUS "Enabling Metal acceleration for stable-diffusion.cpp on macOS")
endif()
# Enable CUDA on systems with NVIDIA GPUs
find_package(CUDAToolkit QUIET)
if(CUDAToolkit_FOUND)
set(SD_CUDA ON CACHE BOOL "" FORCE)
message(STATUS "CUDA found - enabling GPU acceleration for stable-diffusion.cpp")
endif()
FetchContent_Declare(
stable_diffusion_cpp
GIT_REPOSITORY https://github.com/leejet/stable-diffusion.cpp.git
GIT_TAG 545fac4
GIT_SHALLOW TRUE
)
FetchContent_MakeAvailable(stable_diffusion_cpp)
# Include stable-diffusion.cpp headers
include_directories(
${stable_diffusion_cpp_SOURCE_DIR}
)
add_definitions(-DENABLE_STABLE_DIFFUSION)
message(STATUS "AI texture generation enabled with stable-diffusion.cpp")
endif()
##############################################################
# Sentry crash reporting and analytics
##############################################################
option(ENABLE_SENTRY "Enable Sentry crash reporting and analytics" ON)
if(ENABLE_SENTRY)
include(FetchContent)
set(SENTRY_BACKEND "inproc" CACHE STRING "" FORCE)
set(SENTRY_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(SENTRY_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(SENTRY_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(SENTRY_INTEGRATION_QT ON CACHE BOOL "" FORCE)
FetchContent_Declare(sentry
GIT_REPOSITORY https://github.com/getsentry/sentry-native.git
GIT_TAG 0.7.17
GIT_SHALLOW TRUE
GIT_SUBMODULES_RECURSE FALSE)
FetchContent_MakeAvailable(sentry)
include_directories(${sentry_SOURCE_DIR}/include)
add_definitions(-DENABLE_SENTRY)
endif()
##############################################################
# Find Ogre
##############################################################
find_package(OGRE REQUIRED)
# On Linux, use the OGRE-detected plugin directory instead of a hardcoded path
if(UNIX AND NOT APPLE AND NOT PLUGIN_DIR)
if(OGRE_PLUGIN_DIR)
set(PLUGIN_DIR "${OGRE_PLUGIN_DIR}")
else()
set(PLUGIN_DIR "/usr/local/lib/OGRE/")
endif()
endif()
message("OGRE_INCLUDE_DIRS: ")
message(${OGRE_INCLUDE_DIRS})
include_directories(${OGRE_INCLUDE_DIRS} "${OGRE_INCLUDE_DIRS}/Plugins/Assimp")
##############################################################
# Find ZLIB
##############################################################
OPTION(FIX_NEED_ZLIB "Switch on if your configuration requires zlib" OFF)
if(FIX_NEED_ZLIB)
find_package(ZLIB REQUIRED)
set(OGRE_LIBRARIES ${OGRE_LIBRARIES} ${ZLIB_LIBRARIES})
endif()
##############################################################
# Find Assimp
##############################################################
find_package(assimp REQUIRED)
if (assimp_FOUND)
message("Assimp Found")
set(ASSIMP_LIBRARY "assimp")
add_library(${ASSIMP_LIBRARY} SHARED IMPORTED)
set_target_properties(${ASSIMP_LIBRARY} PROPERTIES IMPORTED_LOCATION "${ASSIMP_LIBRARY_DIRS}/libassimp.so")
include_directories(${ASSIMP_INCLUDE_DIRS})
endif(assimp_FOUND)
##############################################################
# Adding ReadMe file
##############################################################
add_custom_target(readMeFile SOURCES README.md)
##############################################################
# Processing Subdirs
##############################################################
ADD_SUBDIRECTORY(ui_files)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(media)
ADD_SUBDIRECTORY(cfg)
if(BUILD_TESTS)
ADD_SUBDIRECTORY(tests)
endif()
##############################################################
# Install Qt dependencies
##############################################################
IF(WIN32)
MESSAGE(STATUS "Installing Qt DLLs for Windows...")
MESSAGE(STATUS "QT_DIR: ${QT_DIR}")
FOREACH(qtlib ${QTLIBLIST})
MESSAGE(STATUS "Installing ${qtlib}.dll from ${QT_DIR}/../../../bin/")
INSTALL(FILES ${QT_DIR}/../../../bin/${qtlib}.dll DESTINATION ${CMAKE_INSTALL_PREFIX})
ENDFOREACH(qtlib)
SET (QTPLATFORMSLIST
qminimal
qoffscreen
qwindows)
FOREACH(platform ${QTPLATFORMSLIST})
MESSAGE(STATUS "Installing platform plugin ${platform}.dll")
INSTALL(FILES ${QT_DIR}/../../../plugins/platforms/${platform}.dll DESTINATION ${CMAKE_INSTALL_PREFIX}/platforms/)
ENDFOREACH(platform)
# Qt 6: HTTPS requires TLS backend plugins (otherwise QNetworkAccessManager: "TLS initialization failed")
if(IS_DIRECTORY "${QT_DIR}/../../../plugins/tls")
install(DIRECTORY "${QT_DIR}/../../../plugins/tls/" DESTINATION "${CMAKE_INSTALL_PREFIX}/tls")
endif()
ELSEIF(APPLE)
# FOREACH(qtlib ${QTLIBLIST})
# INSTALL(FILES ${QT_DIR}/../../lib${qtlib}.${QT_VERSION_MAJOR}.dylib DESTINATION ${CMAKE_INSTALL_PREFIX})
# ENDFOREACH(qtlib)
ELSEIF(UNIX)
SET (QTLIBLIST ${QTLIBLIST}
Qt${QT_VERSION_MAJOR}XcbQpa
Qt${QT_VERSION_MAJOR}EglFSDeviceIntegration
Qt${QT_VERSION_MAJOR}DBus
Qt${QT_VERSION_MAJOR}WaylandClient
Qt${QT_VERSION_MAJOR}OpenGL)
FOREACH(qtlib ${QTLIBLIST})
INSTALL(FILES ${QT_DIR}/../../lib${qtlib}.so.${QT_VERSION} DESTINATION ${CMAKE_INSTALL_PREFIX}/)
INSTALL(FILES ${QT_DIR}/../../lib${qtlib}.so.${QT_VERSION_MAJOR} DESTINATION ${CMAKE_INSTALL_PREFIX}/)
INSTALL(FILES ${QT_DIR}/../../lib${qtlib}.so DESTINATION ${CMAKE_INSTALL_PREFIX}/)
# INSTALL(FILES ${QT_DIR}/../../lib${qtlib}.so.${QT_VERSION} DESTINATION /usr/local/lib)
# INSTALL(FILES ${QT_DIR}/../../lib${qtlib}.so.${QT_VERSION_MAJOR} DESTINATION /usr/local/lib)
# INSTALL(FILES ${QT_DIR}/../../lib${qtlib}.so DESTINATION /usr/local/lib)
ENDFOREACH(qtlib)
SET (QTPLATFORMSLIST
qminimal
qxcb
qeglfs
qwayland-generic)
FOREACH(platform ${QTPLATFORMSLIST})
INSTALL(FILES ${QT_DIR}/../../../plugins/platforms/lib${platform}.so DESTINATION ${CMAKE_INSTALL_PREFIX}/platforms/)
ENDFOREACH(platform)
# Qt 6: HTTPS requires TLS backend plugins (otherwise QNetworkAccessManager: "TLS initialization failed")
if(IS_DIRECTORY "${QT_DIR}/../../../plugins/tls")
install(DIRECTORY "${QT_DIR}/../../../plugins/tls/" DESTINATION "${CMAKE_INSTALL_PREFIX}/tls")
endif()
# Install Qt QML modules required for Material Editor
# When Qt libraries are bundled, Qt can't find system QML modules automatically
get_filename_component(QT_BASE_DIR "${QT_DIR}/../../.." ABSOLUTE)
set(QT_QML_DIR "")
foreach(_qml_candidate
"${QT_BASE_DIR}/qml"
"${QT_BASE_DIR}/lib/qt6/qml"
"${QT_BASE_DIR}/lib/x86_64-linux-gnu/qt6/qml"
"${QT_BASE_DIR}/share/qt6/qml")
if(EXISTS "${_qml_candidate}/QtQuick")
set(QT_QML_DIR "${_qml_candidate}")
break()
endif()
endforeach()
if(QT_QML_DIR)
message(STATUS "Found Qt QML modules at: ${QT_QML_DIR}")
set(QML_MODULES_TO_INSTALL
QtQuick
QtQuick/Controls
QtQuick/Controls/Basic
QtQuick/Layouts
QtQuick/Templates
QtQuick/Dialogs
QtQml
QtQml/Models
QtQml/WorkerScript)
foreach(module ${QML_MODULES_TO_INSTALL})
if(EXISTS "${QT_QML_DIR}/${module}")
# Get the parent directory of the module for correct installation structure
get_filename_component(_module_parent "${module}" DIRECTORY)
install(DIRECTORY "${QT_QML_DIR}/${module}"
DESTINATION "${CMAKE_INSTALL_PREFIX}/qml/${_module_parent}"
COMPONENT Runtime)
endif()
endforeach()
else()
message(WARNING "Could not find Qt QML modules directory - QML features may not work in installed version")
endif()
ENDIF()
# This is a test for deploying using qt script, still needs more investigation.
#if(NOT APPLE)
# # Generate the deployment script for the target QtMeshEditor.
# qt_generate_deploy_app_script(
# TARGET QtMeshEditor
# FILENAME_VARIABLE deploy_script
# NO_UNSUPPORTED_PLATFORM_ERROR
# )
# # Call the deployment script on "cmake --install".
# install(SCRIPT ${deploy_script})
#endif()
##############################################################
# DEB package
##############################################################
if(LINUX)
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/DEBIAN-control.in"
"${CMAKE_INSTALL_PREFIX}/DEBIAN-control"
@ONLY)
endif()
##############################################################
# CPACK
##############################################################
# Destination paths below are relative to ${CMAKE_INSTALL_PREFIX}
install(TARGETS ${APP_NAME}
BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime
)
set(CPACK_PACKAGE_NAME "QtMeshEditor")
set(CPACK_PACKAGE_VENDOR "Fernando")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A graphical editor for Ogre3D mesh, material and skeleton")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/License")
set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
if(APPLE)
# Note Mac specific extension .app
set(APPS "\${CMAKE_INSTALL_PREFIX}/${CMAKE_PROJECT_NAME}.app")
# Directories to look for dependencies
set(DIRS ${CMAKE_INSTALL_PREFIX})
set(CPACK_GENERATOR "DragNDrop")
elseif(UNIX)
set(CPACK_GENERATOR "DEB")
# For now, only linux is using CPACK
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Fernando Tonon <tonon.fernando@hotmail.com>")
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
set(CPACK_VERBATIM_VARIABLES ON)
# set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/QtMeshEditor")
set(CPACK_DEBIAN_PACKAGE_DEPENDS libicui18n.so.56 libicuuc.so.56 libicudata.so.56)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
elseif(WIN32)
# Define NSIS installation types
set(CPACK_ALL_INSTALL_TYPES Full Developer)
endif()
# Must be after the last CPACK macros
include(CPack)