-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
70 lines (61 loc) · 1.4 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
cmake_minimum_required(VERSION 3.2)
project(glfw-occt-demo)
set(CMAKE_CXX_STANDARD 11)
set(APP_VERSION_MAJOR 1)
set(APP_VERSION_MINOR 0)
set(APP_TARGET glfwocct)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
file(GLOB SOURCES
*.h
*.cpp
)
source_group ("Headers" FILES
GlfwOcctView.h
GlfwOcctWindow.h)
source_group ("Sources" FILES
GlfwOcctView.cpp
GlfwOcctWindow.cpp
main.cpp)
# OpenGL
find_package(OpenGL REQUIRED)
# Open CASCADE Technology
# set(OpenCASCADE_DIR "/usr/local/opt/occt/lib/cmake/opencascade")
find_package(OpenCASCADE REQUIRED NO_DEFAULT_PATH)
if (OpenCASCADE_FOUND)
message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_DIR}\"" )
INCLUDE_DIRECTORIES(${OpenCASCADE_INCLUDE_DIR})
LINK_DIRECTORIES(${OpenCASCADE_LIBRARY_DIR})
else()
message (WARNING "Could not find OpenCASCADE, please set OpenCASCADE_DIR variable." )
set (OCCT_LIBRARY_DIR)
set (OCCT_BIN_DIR)
endif()
SET(OpenCASCADE_LIBS
TKernel
TKService
TKV3d
TKOpenGl
TKBRep
TKGeomBase
TKGeomAlgo
TKG3d
TKG2d
TKTopAlgo
TKPrim
)
# glfw
find_package(glfw3 REQUIRED)
if (glfw3_FOUND)
message (STATUS "Using glfw3 ${glfw3_VERSION}" )
INCLUDE_DIRECTORIES(${GLFW_INCLUDE_DIRS})
LINK_DIRECTORIES(${GLFW_LIBRARY_DIRS})
else()
message (STATUS "glfw3 is not found." )
endif()
add_executable(${APP_TARGET} ${SOURCES})
target_link_libraries(
${APP_TARGET}
${OpenCASCADE_LIBS}
glfw
${OPENGL_LIBRARIES}
)