This repository has been archived by the owner on Nov 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
75 lines (55 loc) · 2.36 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
# Project definition
cmake_minimum_required(VERSION 3.9)
project(Engine)
include(C:/dev/scripts/buildsystems/vcpkg.cmake)
# Source files
#set(CMAKE_BUILD_TYPE Debug)
set(dir ${CMAKE_CURRENT_SOURCE_DIR})
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/source")
set(LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries")
#file(COPY ${SRC_DIR}/res DESTINATION ${dir}/build)
file(REMOVE_RECURSE ${dir}/build/Debug/res)
file(COPY ${dir}/resources DESTINATION ${dir}/build/Debug)
file(GLOB APP_S "${SRC_DIR}/*.cpp")
file(GLOB APP_H "${SRC_DIR}/*.h")
file(GLOB REN_S "${SRC_DIR}/Rendering/*.cpp")
file(GLOB REN_H "${SRC_DIR}/Rendering/*.h")
file(GLOB GUI_S "${SRC_DIR}/GUI/*.cpp")
file(GLOB GUI_H "${SRC_DIR}/GUI/*.h")
file(GLOB FILES
"${SRC_DIR}/*.cpp"
"${SRC_DIR}/*.hpp"
"${SRC_DIR}/Rendering/*.cpp"
"${SRC_DIR}/Rendering/*.hpp"
"${SRC_DIR}/Panel/*.cpp"
"${SRC_DIR}/Panel/*.hpp"
"${SRC_DIR}/Scene/*.cpp"
"${SRC_DIR}/Scene/*.hpp")
find_package(imgui CONFIG REQUIRED)
find_package(imguizmo CONFIG REQUIRED)
find_path(STB_INCLUDE_DIRS "stb.h")
find_package(glfw3 CONFIG REQUIRED)
find_package(glad CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(assimp CONFIG REQUIRED)
find_package(yaml-cpp CONFIG REQUIRED)
if (WIN32 AND BUILD_SHARED_LIBS)
target_compile_definitions (yaml-cpp INTERFACE ${PROJECT_NAME}_DLL)
endif (WIN32 AND BUILD_SHARED_LIBS)
#add_executable(${PROJECT_NAME} ${APP_S} ${APP_H} ${REN_S} ${REN_H} ${GUI_S} ${GUI_H})
# add_executable(${PROJECT_NAME} ${APP_S} ${APP_H} ${REN_S} ${REN_H})
add_executable(${PROJECT_NAME} ${FILES})
target_include_directories(${PROJECT_NAME} PRIVATE "${SRC_DIR}")
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
target_include_directories(${PROJECT_NAME} PRIVATE ${STB_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} PRIVATE glm::glm)
target_link_libraries(${PROJECT_NAME} PRIVATE imgui::imgui)
target_link_libraries(${PROJECT_NAME} PRIVATE imguizmo::imguizmo)
target_link_libraries(${PROJECT_NAME} PRIVATE glad::glad)
target_link_libraries(${PROJECT_NAME} PRIVATE glfw)
target_link_libraries(${PROJECT_NAME} PRIVATE assimp::assimp)
target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp)
# include_directories("dep/yaml-cpp/include")
# target_link_libraries(${PROJECT_NAME} "dep/yaml-cpp/src")
#add_subdirectory("dep/yaml-cpp")
file(COPY ${dir}/resources DESTINATION ${dir}/build/Debug)