-
-
Notifications
You must be signed in to change notification settings - Fork 782
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
78 lines (67 loc) · 2.31 KB
/
CMakeLists.txt
File metadata and controls
78 lines (67 loc) · 2.31 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
cmake_minimum_required (VERSION 3.16)
if(APPLE)
# When using precompiled headers on macOS, we need to enable Objective-C
# as a distinct language. This won't work on other platforms (will fail to
# find the Obj-C compiler), hence the "if APPLE".
project ("DearPyGui" LANGUAGES C CXX OBJC OBJCXX)
else()
project ("DearPyGui")
endif()
if(WIN32)
add_definitions(-DIMGUI_USER_CONFIG="mvImGuiConfig_win32.h")
add_definitions(-DMV_PLATFORM="windows")
elseif(APPLE)
add_definitions(-DIMGUI_USER_CONFIG="mvImGuiConfig_apple.h")
add_definitions(-DMV_PLATFORM="apple")
else() # Linux
add_definitions(-DIMGUI_USER_CONFIG="mvImGuiConfig_linux.h")
add_definitions(-DMV_PLATFORM="linux")
endif()
if(WIN32)
else() # Linux
add_definitions(-DCUSTOM_IMGUIFILEDIALOG_CONFIG="ImGuiFileDialogConfigUnix.h")
endif()
# various settings
add_definitions(
-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR
-D_CRT_SECURE_NO_WARNINGS
-D_USE_MATH_DEFINES)
set(MV_PY_VERSION ${MV_PY_VERSION})
set(MVDPG_VERSION ${MVDPG_VERSION})
add_definitions(-DMV_DPG_MAJOR_VERSION=1)
add_definitions(-DMV_DPG_MINOR_VERSION=0)
if(MVDPG_VERSION)
add_definitions(-DMV_SANDBOX_VERSION="${MVDPG_VERSION}")
else()
add_definitions(-DMV_SANDBOX_VERSION="master")
endif()
# when set to "ON", the embedded version
# will be the only version build (no sandbox builds)
set(MVDIST_ONLY ${MVDIST_ONLY})
if(MVDIST_ONLY)
add_definitions(-DMVDIST_ONLY)
else()
add_definitions(-DMV_LOG)
endif()
# runs python tests
set(MV_TESTS_ONLY ${MV_TESTS_ONLY})
if(MV_TESTS_ONLY)
add_definitions(-DMV_TESTS_ONLY)
endif()
# Specifying MV_NO_USER_THREADS turns off some thread safety features (might give
# you some perf gain, yeah, those 0.01%) and must only be used when no user threads
# (threading.Thread) **ever** call DPG API. With MV_NO_USER_THREADS, it's only
# allowed to call DPG from the main thread and from handlers/callbacks.
# Also can be used to get back the behavior of old DPG versions that were thread
# unsafe (for testing/debugging).
set(MV_NO_USER_THREADS ${MV_NO_USER_THREADS})
if(MV_NO_USER_THREADS)
add_definitions(-DMV_NO_USER_THREADS)
endif()
add_subdirectory("thirdparty")
# if this is not a distribution build
# build development environment
if(NOT MVDIST_ONLY)
add_subdirectory ("sandbox")
endif()
add_subdirectory ("src")