-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
53 lines (39 loc) · 1.04 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
cmake_minimum_required(VERSION 3.13.3)
project(base C CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
file(GLOB TOOLS src/tools/*.cpp)
file(GLOB COMMONS src/commons/*.cpp)
file(GLOB PHYSICS src/physics/*.cpp)
add_library(base
${TOOLS}
${COMMONS}
${PHYSICS}
)
target_compile_features(base PUBLIC cxx_std_11)
add_executable(out src/main.cpp)
# glfw
find_package(glfw3 REQUIRED)
include_directories(${GLFW_INCLUDE_DIRS})
link_libraries(${GLFW_LIBRARY_DIRS})
# opengl
find_package(OpenGL REQUIRED)
include_directories(${OPENGL_INCLUDE_DIRS})
# glew
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
#target_compile_features(base PUBLIC cxx_std_11)
#set_target_properties(out PROPERTIES
# LINKER_LANGUAGE CXX)
target_link_libraries(
out
PRIVATE
base
glfw
${OPENGL_LIBRARIES}
${GLEW_LIBRARIES}
)
install(TARGETS out DESTINATION /usr/lib)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-o3 -fopenmp")
endif()