-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
60 lines (43 loc) · 1.52 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
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 14)
project(E57Viewer VERSION 1.0)
set(E57Viewer 1.0)
FUNCTION(PREPEND var )
SET(listVar "")
FOREACH(f ${${var}})
LIST(APPEND listVar "${CMAKE_CURRENT_SOURCE_DIR}/${f}")
ENDFOREACH(f)
SET(${var} "${listVar}" PARENT_SCOPE)
ENDFUNCTION(PREPEND)
# Find GLFW
find_package(glfw3 3.3 REQUIRED)
include_directories(${GLFW_INCLUDE_DIRS})
link_directories(${GLFW_LIBRARY_DIRS})
add_definitions(${GLFW_DEFINITIONS})
# Find GLEW
find_package(GLEW REQUIRED)
include_directories(${GLEW_INCLUDE_DIRS})
link_directories(${GLEW_LIBRARY_DIRS})
add_definitions(${GLEW_DEFINITIONS})
find_package(OpenGL REQUIRED)
include_directories(${OpenGL_INCLUDE_DIRS})
link_directories(${OpenGL_LIBRARY_DIRS})
add_definitions(${OpenGL_DEFINITIONS})
if(NOT OpenGL_FOUND)
message(Error "OpenGL not found")
endif(NOT OpenGL_FOUND)
add_subdirectory( extern/imgui )
add_subdirectory( extern/libE57Format )
add_subdirectory( include )
add_subdirectory( src )
add_executable(e57viewer ${E57Viewer_SRC} ${E57Viewer_INC} )
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib")
target_include_directories(e57viewer PUBLIC
# headers to include when building from source
${E57Viewer_SOURCE_DIR}/extern/stb
${E57Viewer_SOURCE_DIR}/extern/imgui
# ${E57Viewer_BINARY_DIR}/include
)
target_link_libraries(e57viewer imgui E57Format glfw ${OPENGL_LIBRARIES} ${GLEW_LIBRARIES})
# Install Stuff