-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
52 lines (44 loc) · 1.64 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
cmake_minimum_required (VERSION 3.19)
project(animgui)
set(CMAKE_CXX_STANDARD 17)
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_compile_definitions("ANIMGUI_DEBUG")
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_compile_definitions("UNICODE")
add_compile_definitions("_UNICODE")
add_compile_options("/utf-8")
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_compile_options("/Od" "/Oy-")
else()
add_compile_options("/O2" "/Ob2" "/Oi" "/Ot" "/Oy" "/GT" "/GL" "/Qpar")
add_link_options("/LTCG:incremental" "/OPT:REF" "/OPT:ICF")
endif()
elseif(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_BUILD_TYPE MATCHES Debug)
add_compile_options("-fsanitize=address" "-O0" "-fno-omit-frame-pointer")
link_libraries(asan)
else()
add_compile_options("-Ofast")
endif()
endif()
option(BACKEND_GLFW3 "build glfw3 backend" on)
option(BACKEND_STB_FONT "build stb_font backend" on)
option(BACKEND_OPENGL3 "build opengl3 backend" on)
option(BACKEND_VULKAN "build vulkan backend" on)
if(WIN32)
option(BACKEND_D3D11 "build d3d11 backend" on)
option(BACKEND_D3D12 "build d3d12 backend" on)
elseif(APPLE)
option(BACKEND_METAL "build metal backend" on)
endif()
include_directories(BEFORE include)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_subdirectory(src)
add_subdirectory(examples)
install(FILES LICENSE DESTINATION ./)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/include DESTINATION ./)
install(DIRECTORY ${CMAKE_BINARY_DIR}/lib DESTINATION ./)
install(DIRECTORY ${CMAKE_BINARY_DIR}/bin DESTINATION ./)