ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/CMakeLists.txt
(Generate patch)

Comparing ray/CMakeLists.txt (file contents):
Revision 1.21 by greg, Wed Jun 20 20:51:24 2018 UTC vs.
Revision 1.33 by greg, Thu Jul 24 01:24:01 2025 UTC

# Line 1 | Line 1
1 < cmake_minimum_required(VERSION 3.0)
1 > # RCSid $Id$
2 >
3 > cmake_minimum_required(VERSION 3.12)
4   cmake_policy(SET CMP0020 NEW)
5   cmake_policy(SET CMP0048 NEW)
6 < if(NOT ${CMAKE_VERSION} VERSION_LESS "3.1")
7 <  cmake_policy(SET CMP0054 NEW)
6 > cmake_policy(SET CMP0054 NEW)
7 > cmake_policy(SET CMP0074 NEW)
8 >
9 > # project-defined modules
10 > set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/resources/cmake/modules")
11 >
12 > set(SUPPORTED_LANGUAGES C CXX)
13 >
14 > # Get the project version.
15 > set(VERSIONFILE "${CMAKE_CURRENT_LIST_DIR}/src/rt/VERSION")
16 > if(EXISTS ${VERSIONFILE})
17 >  file(READ  ${VERSIONFILE} NAMEVERSION)
18 >  if(${NAMEVERSION} MATCHES "^([A-Za-z]+) +([0-9]+\\.[0-9]+)")
19 >    # project name must be lower case, or the CPack module fails
20 >    string(TOLOWER ${CMAKE_MATCH_1} PROGNAME)
21 >    project(${PROGNAME} VERSION ${CMAKE_MATCH_2} LANGUAGES ${SUPPORTED_LANGUAGES})
22 >  endif()
23 > else()
24 >    project(radiance LANGUAGES ${SUPPORTED_LANGUAGES})
25   endif()
26  
27 < project(radiance VERSION 5.2.0)
27 > message("Project: " ${CMAKE_PROJECT_NAME} " " ${PROJECT_VERSION})
28  
29   set(PROJECT_VERSION_TWEAK "Unknown" CACHE STRING "Commit Hash")
30   find_package(Git)
# Line 30 | Line 49 | option(BUILD_SHARED_LIBS "Build radiance using shared
49   option(BUILD_HEADLESS "Build radiance without any GUI components?" OFF)
50   option(BUILD_PABOPTO_UTILS "Build PABOpto Utilities?" OFF)
51   option(BUILD_LIBTIFF "Build libtiff?" OFF)
52 + option(BUILD_QT "Build Qt related stuff?" OFF)
53  
54   if(NOT WIN32)
55    set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1)
56    install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/" DESTINATION man)
57 <  set(qt_plugin_term "PLUGIN")
57 >  if(BUILD_QT)
58 >    set(qt_plugin_term "PLUGIN")
59 >  endif()
60   endif()
61  
62   if(WIN32)
63 +  set(CPACK_NSIS_INSTALL_ROOT "C:")
64    set(CPACK_NSIS_MODIFY_PATH 1)
65 <  set(qt_plugin_term "LIBRARY")
65 >  if(BUILD_QT)
66 >    set(qt_plugin_term "LIBRARY")
67 >  endif()
68  
69    # Set RAYPATH on install
70    set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
# Line 63 | Line 88 | set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${P
88  
89   if(APPLE)
90    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c11 -std=c++11 -stdlib=libc++")
91 +  add_compile_options(-O2 -DBSD -DNOSTEREO -Dfreebsd)
92    add_definitions(-DBSD -DNOSTEREO -Dfreebsd)
93 <  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.7")
93 >  set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13")
94   endif()
95  
96   if(BUILD_LIBTIFF)
# Line 77 | Line 103 | if(BUILD_LIBTIFF)
103        URL_MD5 ${LIBTIFF_MD5}
104        CMAKE_GENERATOR "NMake Makefiles"
105        CMAKE_ARGS
106 +        "-UHAVE_UNISTD_H"
107          "-DBUILD_SHARED_LIBS=OFF"
108          "-DCMAKE_BUILD_TYPE=Release"
109          "-Dzlib=OFF"
# Line 116 | Line 143 | endif()
143   include(CPack)
144  
145   if(NOT BUILD_HEADLESS)
146 <  find_package(Qt5Widgets)
147 <  get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION)
148 <  get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH)
149 <  get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/.." ABSOLUTE)
146 >  if(BUILD_QT)
147 >    find_package(Qt5Widgets)
148 >    get_target_property(QT_LIBRARY_DIR Qt5::Core LOCATION)
149 >    get_filename_component(QT_LIBRARY_DIR ${QT_LIBRARY_DIR} PATH)
150 >    get_filename_component(QT_LIBRARY_DIR "${QT_LIBRARY_DIR}/.." ABSOLUTE)
151 >  endif()
152 >  if(APPLE)
153 >    set(X11_ROOT "/opt/X11")
154 >  endif()
155    find_package(X11)
156    if(APPLE)
157       include_directories(${X11_INCLUDE_DIR})
158 <  endif()
158 >   endif()
159 >   if(APPLE AND X11_FOUND)
160 >     set(CMAKE_FIND_FRAMEWORK NEVER)
161 >     set(OpenGL_ROOT "/opt/X11")
162 >     find_package(OpenGL)
163 >     set(CMAKE_FIND_FRAMEWORK "")
164 >   else()
165 >     find_package(OpenGL)
166 >   endif()
167 >
168   endif()
169  
170   set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
171  
172   if(MSVC)
173    add_definitions(/MP)
174 +  # Suppress warnings about double-to-float assignments and initializations
175 +  add_compile_options(/wd"4244" /wd"4305")
176   endif()
177   if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
178    set(_INTEL_WINDOWS 1)
# Line 150 | Line 193 | add_subdirectory(resources)
193   install(DIRECTORY "${CMAKE_BINARY_DIR}/lib/"
194    DESTINATION "lib"
195   )
196 +
197 + # copy make tests to build
198 + file(COPY test DESTINATION ${CMAKE_BINARY_DIR})
199 +
200  
201   include(InstallRequiredSystemLibraries)
202   add_subdirectory(InstallRules)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines