-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
93 lines (80 loc) · 1.92 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
cmake_minimum_required(VERSION 3.2)
project(stock)
add_subdirectory(deps)
set(STOCK_SOURCES
src/debug/DebugDraw.hpp
src/debug/DebugDraw.cpp
src/gl/Error.hpp
src/gl/Error.cpp
src/gl/Framebuffer.hpp
src/gl/Framebuffer.cpp
src/gl/Mesh.hpp
src/gl/Mesh.cpp
src/gl/Pixmap.hpp
src/gl/Pixmap.cpp
src/gl/RenderState.hpp
src/gl/RenderState.cpp
src/gl/ShaderProgram.hpp
src/gl/ShaderProgram.cpp
src/gl/ShaderUniform.hpp
src/gl/ShaderUniform.cpp
src/gl/Texture.hpp
src/gl/Texture.cpp
src/gl/VertexLayout.hpp
src/gl/VertexLayout.cpp
src/io/File.hpp
src/io/File.cpp
src/io/Log.hpp
src/io/Log.cpp
src/io/Url.hpp
src/io/Url.cpp
src/io/UrlSession.hpp
src/io/UrlSession.cpp
src/transform/Transform.hpp
src/transform/Transform.cpp
src/view/Camera.hpp
src/view/Camera.cpp
src/ImGuiImpl.hpp
src/ImGuiImpl.cpp
)
add_library(stock ${STOCK_SOURCES})
source_group(TREE ${PROJECT_SOURCE_DIR} FILES ${STOCK_SOURCES})
set_target_properties(stock PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED ON
)
target_include_directories(stock PUBLIC
src
deps/glm
deps/stb
)
target_link_libraries(stock PUBLIC
glad
glfw
${GLFW_LIBRARIES}
${OPENGL_LIBRARIES}
imgui
)
add_executable(app
src/main.cpp
)
set_target_properties(app PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED ON
)
target_link_libraries(app PRIVATE
stock
)
add_subdirectory(tests)
if(WIN32)
execute_process(COMMAND conan install ${PROJECT_SOURCE_DIR}/conanfile.txt
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
RESULT_VARIABLE CONAN_INSTALL_RESULT
)
message(STATUS "Conan install result: ${CONAN_INSTALL_RESULT}")
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
target_link_libraries(stock PUBLIC CONAN_PKG::libcurl)
else()
target_link_libraries(stock PUBLIC curl)
endif()