-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
72 lines (53 loc) · 1.6 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
71
72
cmake_minimum_required(VERSION 3.13)
project(relight)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_FIND_FRAMEWORK LAST)
option(MACOSX_MAKE_BUNDLE "If using macos, all targets will be placed in a relight macosx app bundle" ON)
find_package(Qt6 COMPONENTS Core Gui Widgets Concurrent Xml QUIET)
if (Qt6_FOUND)
set(RELIGHT_QT Qt6)
message("Using Qt6")
else()
find_package(Qt5 COMPONENTS Core Gui Widgets Concurrent Xml QUIET)
if(Qt5_FOUND)
set(RELIGHT_QT Qt5)
message("Using Qt5")
else()
message(FATAL_ERROR "Qt not found")
endif()
endif()
find_package(Eigen3)
find_package(OpenMP)
if(MACOSX_MAKE_BUNDLE)
set(MACOSX_EXE_TARGET_OPTION MACOSX_BUNDLE)
else()
set(MACOSX_EXE_TARGET_OPTION "")
endif()
if(NOT Eigen3_FOUND)
set(EIGEN3_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/eigen-3.3.9)
endif()
if(MSVC)
set(JPEGTURBO_HOME ${CMAKE_CURRENT_SOURCE_DIR}/external/libjpeg-turbo-2.0.6)
set(JPEG_INCLUDE_DIR ${JPEGTURBO_HOME}/include)
set(JPEG_LIBRARIES ${JPEGTURBO_HOME}/lib/jpeg.lib)
else()
find_package (JPEG REQUIRED)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/RELIGHT_VERSION")
# version is read from RELIGHT_VERSION file
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/RELIGHT_VERSION" RELIGHT_VERSION)
else() # should never happen
set(RELIGHT_VERSION "test")
endif()
message("Relight Version: " ${RELIGHT_VERSION})
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/relight_tools.cmake)
# install options
if(WIN32 OR APPLE)
set(INSTALL_TO_UNIX_LAYOUT OFF)
else()
set(INSTALL_TO_UNIX_LAYOUT ON)
endif()
include(GNUInstallDirs)
add_subdirectory(relight)
add_subdirectory(relight-cli)
add_subdirectory(relight-merge)