generated from nobuyuki83/Physics-based_Animation_2023S
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (37 loc) · 1.09 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
cmake_minimum_required(VERSION 3.12) # specify the version of cmake
#############################
# set C++ detail
enable_language(CXX) # we are using C++
set(CMAKE_CXX_STANDARD 17) # we are using C++ 17
set(CMAKE_CXX_STANDARD_REQUIRED TRUE) # we are using STL library
IF(MSVC)
set(CMAKE_CXX_FLAGS "/W4")
ELSE()
set(CMAKE_CXX_FLAGS "-Wall -Wextra -g")
ENDIF()
#############################
# set project name
project(task00)
#############################
# specifying libraries to use
# use opengl
find_package(OpenGL REQUIRED)
# use glfw
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../external/glfwlib) # give hint to cmake to find glfw library
find_package(glfw3 REQUIRED)
########################
# include, build, and link
include_directories(
)
add_executable(${PROJECT_NAME}
main.cpp
)
target_link_libraries(${PROJECT_NAME}
OpenGL::GL # use OpenGL library
glfw # use glfw library
)
#############################
# showing status of libraries
GET_TARGET_PROPERTY(GLFW_INCLUDE_DIR
glfw INTERFACE_INCLUDE_DIRECTORIES)
message(STATUS "glfw include directory: ${GLFW_INCLUDE_DIR}")