-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (36 loc) · 1.15 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
cmake_minimum_required(VERSION 3.0)
project(GLBase VERSION 0.0.1)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(INCLUDES
"deps/glew/include"
"deps/glfw/include"
"deps/imgui/include"
"include"
)
add_subdirectory(deps)
file(GLOB_RECURSE GLBase_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.c*)
add_library(GLBase STATIC ${GLBase_SOURCES})
target_link_libraries(GLBase
glew_s
glfw
imgui
)
target_include_directories(GLBase PUBLIC ${INCLUDES})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
option(BUILD_TESTS "Build test executables" ON)
option(BUILD_EXAMPLES "Build example executable" ON)
if(${BUILD_TESTS})
include(CTest)
enable_testing()
add_executable(math_tests tests/math.cpp)
add_executable(layout_tests tests/vertexlayout.cpp)
add_test(NAME MathTests COMMAND math_tests)
add_test(NAME LayoutTests COMMAND layout_tests)
target_link_libraries(math_tests GLBase)
target_link_libraries(layout_tests GLBase)
endif(${BUILD_TESTS})
if(${BUILD_EXAMPLES})
add_executable(sandbox examples/sandbox.cpp)
target_link_libraries(sandbox GLBase)
endif(${BUILD_EXAMPLES})