-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (31 loc) · 1.37 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.3)
project(bb-vulkan-engine
DESCRIPTION "A shared object library for rendering shaders in a window"
VERSION 0.2
)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_executable(testbin)
add_library(${PROJECT_NAME} SHARED)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(testbin PRIVATE ${PROJECT_NAME})
add_subdirectory(src)
if (UNIX)
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/lib)
install(FILES include/bb-engine.h DESTINATION include)
target_link_options(${PROJECT_NAME} PRIVATE -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi)
endif (UNIX)
target_compile_options(${PROJECT_NAME} PRIVATE -std=c++17 -fvisibility=hidden $<$<CONFIG:Debug>:-O0;-g3;-ggdb>)
target_compile_definitions(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>: DEBUG>)
add_subdirectory(lib/bb-net-lib)
target_link_libraries(${PROJECT_NAME} PRIVATE bbnetlib)
add_subdirectory(lib/glfw)
target_link_libraries(${PROJECT_NAME} PRIVATE glfw)
target_link_libraries(testbin PRIVATE glfw)
add_subdirectory(lib/glm)
target_link_libraries(${PROJECT_NAME} PRIVATE glm)
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(OpenGL_GL_PREFERENCE GLVND)
find_package(OpenGL REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenGL::GL)