0032137: Coding Rules - merge redundant .lxx files into header files within Package gp
[occt.git] / samples / glfw / CMakeLists.txt
CommitLineData
9c0787df 1cmake_minimum_required(VERSION 3.2)
2
3project(glfw-occt-demo)
4
5set(CMAKE_CXX_STANDARD 11)
6set(APP_VERSION_MAJOR 1)
7set(APP_VERSION_MINOR 0)
8set(APP_TARGET glfwocct)
9
10INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
11file(GLOB SOURCES
12 *.h
13 *.cpp
14)
15source_group ("Headers" FILES
16 GlfwOcctView.h
17 GlfwOcctWindow.h)
18source_group ("Sources" FILES
19 GlfwOcctView.cpp
20 GlfwOcctWindow.cpp
21 main.cpp)
22
23# OpenGL
24find_package(OpenGL REQUIRED)
25
26# Open CASCADE Technology
27find_package(OpenCASCADE REQUIRED NO_DEFAULT_PATH)
28if (OpenCASCADE_FOUND)
29 message (STATUS "Using OpenCASCADE from \"${OpenCASCADE_DIR}\"" )
30 INCLUDE_DIRECTORIES(${OpenCASCADE_INCLUDE_DIR})
31 LINK_DIRECTORIES(${OpenCASCADE_LIBRARY_DIR})
32else()
33 message (WARNING "Could not find OpenCASCADE, please set OpenCASCADE_DIR variable." )
34 set (OCCT_LIBRARY_DIR)
35 set (OCCT_BIN_DIR)
36endif()
37
38SET(OpenCASCADE_LIBS
39 TKernel
40 TKService
41 TKV3d
42 TKOpenGl
43 TKBRep
44 TKGeomBase
45 TKGeomAlgo
46 TKG3d
47 TKG2d
48 TKTopAlgo
49 TKPrim
50)
51
52# glfw
53find_package(glfw3 REQUIRED)
54if (glfw3_FOUND)
55 message (STATUS "Using glfw3 ${glfw3_VERSION}" )
56 INCLUDE_DIRECTORIES(${GLFW_INCLUDE_DIRS})
57 LINK_DIRECTORIES(${GLFW_LIBRARY_DIRS})
58else()
59 message (STATUS "glfw3 is not found." )
60endif()
61
62add_executable(${APP_TARGET} ${SOURCES})
63target_link_libraries(
64 ${APP_TARGET}
65 ${OpenCASCADE_LIBS}
66 glfw
67 ${OPENGL_LIBRARIES}
68)