-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
56 lines (43 loc) · 1.19 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
cmake_minimum_required(VERSION 3.12)
option(USE_STATIC_LIB "compile delfem2 with static library?" OFF)
#########################
enable_language(CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
if (MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
else ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -g")
endif ()
#########################
project(624_DefArapUi)
add_definitions(-DPATH_INPUT_DIR="${PROJECT_SOURCE_DIR}/../../test_inputs")
# glfw
set(CMAKE_PREFIX_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../3rd_party/libglfw)
find_package(glfw3 REQUIRED)
# opengl
find_package(OpenGL REQUIRED)
# dfm2
IF (USE_STATIC_LIB)
add_definitions(-DDFM2_STATIC_LIBRARY=ON)
if (MSVC)
set(DFM2_LIBRARY
${PROJECT_SOURCE_DIR}/../dfm2_static_glfwold/dfm2_static_glfwold.lib)
else ()
set(DFM2_LIBRARY
${PROJECT_SOURCE_DIR}/../dfm2_static_glfwold/libdfm2_static_glfwold.a)
endif ()
ENDIF ()
set(DELFEM2_INCLUDE_DIR "../../include")
#########################
include_directories(
${DELFEM2_INCLUDE_DIR}
)
add_executable(${PROJECT_NAME}
main.cpp
)
target_link_libraries(${PROJECT_NAME}
${DFM2_LIBRARY}
OpenGL::GL
glfw
)