File: CMakeLists.txt

package info (click to toggle)
glvis 4.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,780 kB
  • sloc: cpp: 35,217; ansic: 5,695; sh: 340; makefile: 301; python: 193
file content (116 lines) | stat: -rw-r--r-- 3,243 bytes parent folder | download
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copyright (c) 2010-2026, Lawrence Livermore National Security, LLC. Produced
# at the Lawrence Livermore National Laboratory. All Rights reserved. See files
# LICENSE and NOTICE for details. LLNL-CODE-443271.
#
# This file is part of the GLVis visualization tool and library. For more
# information and source code availability see https://glvis.org.
#
# GLVis is free software; you can redistribute it and/or modify it under the
# terms of the BSD-3 license. We welcome feedback and contributions, see file
# CONTRIBUTING.md for details.

list(APPEND SOURCES
  egl/egl.cpp
  egl/egl_main.cpp
  gl/renderer.cpp
  gl/renderer_core.cpp
  gl/shader.cpp
  gl/types.cpp
  sdl/sdl.cpp
  sdl/sdl_helper.cpp
  sdl/sdl_main.cpp
  aux_vis.cpp
  coll_reader.cpp
  data_state.cpp
  file_reader.cpp
  font.cpp
  gltf.cpp
  glwindow.cpp
  material.cpp
  openglvis.cpp
  palettes.cpp
  palettes_default.cpp
  palettes_base.cpp
  script_controller.cpp
  stream_reader.cpp
  vsdata.cpp
  vssolution.cpp
  vssolution3d.cpp
  vsvector.cpp
  vsvector3d.cpp
  window.cpp)

list(APPEND HEADERS
  egl/egl.hpp
  egl/egl_main.hpp
  gl/attr_traits.hpp
  gl/platform_gl.hpp
  gl/renderer.hpp
  gl/renderer_core.hpp
  gl/shader.hpp
  gl/types.hpp
  sdl/sdl.hpp
  sdl/sdl_helper.hpp
  sdl/sdl_main.hpp
  sdl/sdl_mac.hpp
  aux_vis.hpp
  coll_reader.hpp
  data_state.hpp
  file_reader.hpp
  font.hpp
  geom_utils.hpp
  gltf.hpp
  glwindow.hpp
  logo.hpp
  material.hpp
  openglvis.hpp
  palettes.hpp
  palettes_base.hpp
  script_controller.hpp
  stream_reader.hpp
  visual.hpp
  vsdata.hpp
  vssolution.hpp
  vssolution3d.hpp
  vsvector.hpp
  vsvector3d.hpp
  window.hpp)

if(EMSCRIPTEN)
  # Emscripten build target
  list(APPEND SOURCES aux_js.cpp)
  add_executable(libglvis ${SOURCES} ${HEADERS})

  # Copy font to lib folder
  configure_file(../OpenSans.ttf OpenSans.ttf COPYONLY)

  # Set Emscripten options first, since "-s" emscripten options can't be passed
  # through target_compile_options/target_link_libraries
  string(REPLACE ";" " " _emscripten_opts "${_emscripten_opts}")
  set_target_properties(libglvis PROPERTIES COMPILE_FLAGS "${_emscripten_opts}")
  set_target_properties(libglvis PROPERTIES LINK_FLAGS "${_emscripten_opts}")

  target_compile_definitions(libglvis PUBLIC ${_glvis_compile_defs})
  target_include_directories(libglvis SYSTEM PUBLIC "${_glvis_include_dirs}")
  target_link_libraries(libglvis PUBLIC "${_glvis_libraries}")
else()
  # Desktop build target
  list(APPEND SOURCES gl/renderer_ff.cpp threads.cpp gl2ps.c sdl/sdl_x11.cpp)
  list(APPEND HEADERS gl/renderer_ff.hpp threads.hpp gl2ps.h sdl/sdl_x11.hpp)
  if (APPLE)
    list(APPEND SOURCES sdl/sdl_mac.mm)
    list(APPEND HEADERS sdl/sdl_mac.hpp)
  endif()
  if (WIN32)
    list(APPEND SOURCES sdl/sdl_windows.cpp)
    list(APPEND HEADERS sdl/sdl_windows.hpp)
  endif()
  add_library(glvis ${SOURCES} ${HEADERS})
  target_compile_definitions(glvis PUBLIC "${_glvis_compile_defs}")
  target_compile_options(glvis PUBLIC "${_glvis_compile_opts}")
  target_include_directories(glvis SYSTEM PUBLIC "${_glvis_include_dirs}")
  target_link_libraries(glvis PUBLIC "${_glvis_libraries}")
  if (APPLE)
    target_link_libraries(glvis PUBLIC "-framework Cocoa")
  endif()
endif(EMSCRIPTEN)