-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (39 loc) · 1.81 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
cmake_minimum_required(VERSION 3.15)
set(CMAKE_TOOLCHAIN_FILE "./vcpkg/scripts/buildsystems/vcpkg.cmake")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(NARC)
set(EXEC_NAME NARC)
if (WIN32)
set(NARC_ICON "res/resource.rc")
endif()
if(MSVC)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup")
endif()
add_compile_options("$<$<CONFIG:DEBUG>:-DNARC_DEBUG>")
add_compile_options("$<$<CONFIG:RELWITHDEBINFO>:-DNARC_DEBUG>")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${EXEC_NAME})
file(GLOB NARC_SRC "src/*.cpp" "src/*.h")
add_executable(${EXEC_NAME} ${APP_TYPE} ${NARC_SRC} ${NARC_ICON})
add_definitions(-DGLFW_INCLUDE_NONE)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS)
find_package(glfw3 CONFIG REQUIRED)
target_link_libraries(${EXEC_NAME} PRIVATE glfw)
find_package(cpr CONFIG REQUIRED)
target_link_libraries(${EXEC_NAME} PRIVATE cpr)
find_package(nlohmann_json CONFIG REQUIRED)
target_link_libraries(${EXEC_NAME} PRIVATE nlohmann_json nlohmann_json::nlohmann_json)
find_package(ixwebsocket CONFIG REQUIRED)
target_link_libraries(${EXEC_NAME} PRIVATE ixwebsocket::ixwebsocket)
find_package(spdlog CONFIG REQUIRED)
target_link_libraries(${EXEC_NAME} PRIVATE spdlog::spdlog spdlog::spdlog_header_only)
find_package(fmt CONFIG REQUIRED)
target_link_libraries(${EXEC_NAME} PRIVATE fmt::fmt)
find_package(imgui CONFIG REQUIRED)
target_link_libraries(${EXEC_NAME} PRIVATE imgui::imgui)
add_subdirectory(external/glad)
target_link_libraries(${EXEC_NAME} PRIVATE glad)
add_subdirectory(external/ImGuiTextEditor)
target_link_libraries(${EXEC_NAME} PRIVATE ImGuiTextEditor)