| 1 |
< |
cmake_minimum_required(VERSION 3.0) |
| 1 |
> |
cmake_minimum_required(VERSION 3.5) |
| 2 |
|
cmake_policy(SET CMP0020 NEW) |
| 3 |
|
cmake_policy(SET CMP0048 NEW) |
| 4 |
|
if(NOT ${CMAKE_VERSION} VERSION_LESS "3.1") |
| 30 |
|
option(BUILD_HEADLESS "Build radiance without any GUI components?" OFF) |
| 31 |
|
option(BUILD_PABOPTO_UTILS "Build PABOpto Utilities?" OFF) |
| 32 |
|
option(BUILD_LIBTIFF "Build libtiff?" OFF) |
| 33 |
+ |
option(BUILD_QT "Build Qt related stuff?" OFF) |
| 34 |
|
|
| 35 |
|
if(NOT WIN32) |
| 36 |
|
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1) |
| 37 |
|
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/" DESTINATION man) |
| 38 |
< |
set(qt_plugin_term "PLUGIN") |
| 38 |
> |
if(BUILD_QT) |
| 39 |
> |
set(qt_plugin_term "PLUGIN") |
| 40 |
> |
endif() |
| 41 |
|
endif() |
| 42 |
|
|
| 43 |
|
if(WIN32) |
| 44 |
+ |
set(CPACK_NSIS_INSTALL_ROOT "C:") |
| 45 |
|
set(CPACK_NSIS_MODIFY_PATH 1) |
| 46 |
< |
set(qt_plugin_term "LIBRARY") |
| 46 |
> |
if(BUILD_QT) |
| 47 |
> |
set(qt_plugin_term "LIBRARY") |
| 48 |
> |
endif() |
| 49 |
|
|
| 50 |
|
# Set RAYPATH on install |
| 51 |
|
set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS |
| 70 |
|
if(APPLE) |
| 71 |
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c11 -std=c++11 -stdlib=libc++") |
| 72 |
|
add_definitions(-DBSD -DNOSTEREO -Dfreebsd) |
| 73 |
< |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.7") |
| 73 |
> |
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}) |
| 74 |
> |
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7") |
| 75 |
|
endif() |
| 76 |
|
|
| 77 |
|
if(BUILD_LIBTIFF) |
| 84 |
|
URL_MD5 ${LIBTIFF_MD5} |
| 85 |
|
CMAKE_GENERATOR "NMake Makefiles" |
| 86 |
|
CMAKE_ARGS |
| 87 |
+ |
"-UHAVE_UNISTD_H" |
| 88 |
|
"-DBUILD_SHARED_LIBS=OFF" |
| 89 |
|
"-DCMAKE_BUILD_TYPE=Release" |
| 90 |
|
"-Dzlib=OFF" |
| 124 |
|
include(CPack) |
| 125 |
|
|
| 126 |
|
if(NOT BUILD_HEADLESS) |
| 127 |
< |
find_package(Qt5Widgets) |
| 128 |
< |
get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION) |
| 129 |
< |
get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH) |
| 130 |
< |
get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/.." ABSOLUTE) |
| 127 |
> |
if(BUILD_QT) |
| 128 |
> |
find_package(Qt5Widgets) |
| 129 |
> |
get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION) |
| 130 |
> |
get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH) |
| 131 |
> |
get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/.." ABSOLUTE) |
| 132 |
> |
endif() |
| 133 |
|
find_package(X11) |
| 134 |
|
if(APPLE) |
| 135 |
|
include_directories(${X11_INCLUDE_DIR}) |
| 140 |
|
|
| 141 |
|
if(MSVC) |
| 142 |
|
add_definitions(/MP) |
| 143 |
+ |
# Suppress warnings about double-to-float assignments and initializations |
| 144 |
+ |
add_compile_options(/wd"4244" /wd"4305") |
| 145 |
|
endif() |
| 146 |
|
if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") |
| 147 |
|
set(_INTEL_WINDOWS 1) |
| 162 |
|
install(DIRECTORY "${CMAKE_BINARY_DIR}/lib/" |
| 163 |
|
DESTINATION "lib" |
| 164 |
|
) |
| 165 |
+ |
|
| 166 |
+ |
# copy make tests to build |
| 167 |
+ |
file(COPY test DESTINATION ${CMAKE_BINARY_DIR}) |
| 168 |
+ |
|
| 169 |
|
|
| 170 |
|
include(InstallRequiredSystemLibraries) |
| 171 |
|
add_subdirectory(InstallRules) |