CMakeLists.txt 1.62 KB
Newer Older
Tim Übelhör's avatar
Tim Übelhör committed
1
2
project(scigl_render)

Tim Übelhör's avatar
Tim Übelhör committed
3
cmake_minimum_required(VERSION 2.8.3)
4
set (CMAKE_CXX_STANDARD 11)
Tim Übelhör's avatar
Tim Übelhör committed
5

6
# using conan to manage dependencies
Tim Übelhör's avatar
Tim Übelhör committed
7
8
9
10
if(CONAN_EXPORTED) # when packaging
  include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
  conan_basic_setup()
else() # in user space
11
12
13
14
15
  if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
  message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
  file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.13/conan.cmake"
                "${CMAKE_BINARY_DIR}/conan.cmake")
  endif()
Tim Übelhör's avatar
Tim Übelhör committed
16
17
18
19
20
  include(${CMAKE_BINARY_DIR}/conan.cmake)
  conan_cmake_run(CONANFILE conanfile.py
    BASIC_SETUP
    BUILD missing)
endif()
21

Tim Uebelhoer's avatar
Tim Uebelhoer committed
22
23
# prefer new ABI for OpenGL
set(OpenGL_GL_PREFERENCE "GLVND")
Tim Übelhör's avatar
Tim Übelhör committed
24

Tim Übelhör's avatar
Tim Übelhör committed
25
# library  
26
add_library(scigl_render
Tim Übelhör's avatar
Tim Übelhör committed
27
  src/gl_context.cpp
28
29
  src/buffer/frame_buffer.cpp
  src/buffer/frame_buffer_reader.cpp
30
  src/buffer/texture2d.cpp
Tim Übelhör's avatar
Tim Übelhör committed
31
  src/buffer/texture_reader.cpp
32
  src/render/depth_simulator.cpp
33
  src/render/onscreen_render.cpp
34
  src/render/rasterizer.cpp
Tim Übelhör's avatar
Tim Übelhör committed
35
  src/render/texture_fullscreen_render.cpp
36
  src/scene/cv_camera.cpp
Tim Übelhör's avatar
Tim Übelhör committed
37
38
39
  src/scene/diffuse_light.cpp
  src/scene/mesh.cpp  
  src/scene/model.cpp
40
  src/shader/shader.cpp
Tim Übelhör's avatar
Tim Übelhör committed
41
42
  src/shader/shader_builder.cpp
  src/shader/single_color_shader.cpp)
Tim Übelhör's avatar
Tim Übelhör committed
43
44
target_include_directories(scigl_render PUBLIC include)
target_link_libraries(scigl_render ${CONAN_LIBS})
Tim Übelhör's avatar
Tim Übelhör committed
45

Tim Übelhör's avatar
Tim Übelhör committed
46
# example apps
47
add_executable(scigl_viewer
48
  src/example/scigl_viewer.cpp)
49
target_link_libraries(scigl_viewer
50
  scigl_render)
51

Tim Übelhör's avatar
Tim Übelhör committed
52
53
add_executable(scigl_depth_viewer
  src/example/scigl_depth_viewer.cpp
54
  src/example/depth_offscreen_render.cpp)
Tim Übelhör's avatar
Tim Übelhör committed
55
56
target_link_libraries(scigl_depth_viewer
  scigl_render)