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.32 by greg, Wed Jul 23 16:20:13 2025 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines