ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/CMakeLists.txt
Revision: 1.7
Committed: Mon Jan 8 16:51:32 2018 UTC (6 years, 3 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 1.6: +28 -9 lines
Log Message:
Update to CMake build system from Rob G. and Alex S., adding test cases

File Contents

# User Rev Content
1 greg 1.1 if(UNIX)
2     find_library(LIB_M m DOC "Path to libm")
3     if(NOT LIB_M)
4     message(FATAL_ERROR "Cannot build radiance without libm. Please set LIB_M")
5     endif()
6     else()
7 greg 1.7 set(LIB_M)
8 greg 1.1 endif()
9    
10     include_directories(common)
11 greg 1.2 # create a macro to generate
12     macro(create_version_file version_file)
13     add_custom_command(
14     OUTPUT "${version_file}"
15     COMMAND "${CMAKE_COMMAND}"
16 greg 1.7 -DRADIANCE_VERSION="${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}"
17     -DVERSION_OUT_FILE="${version_file}"
18     -DVERSION_IN_FILE="${radiance_SOURCE_DIR}/src/rt/VERSION"
19     -DVERSION_GOLD="${radiance_SOURCE_DIR}/src/rt/Version.c"
20     -P "${radiance_SOURCE_DIR}/src/rt/create_version.cmake"
21     )
22     endmacro()
23     macro(install_without_extension)
24     foreach(file IN ITEMS ${ARGN})
25     string(REGEX REPLACE "\\.[^.]*$" "" file_we ${file})
26     install(PROGRAMS "${file}"
27     DESTINATION "bin"
28     RENAME "${file_we}"
29     )
30     endforeach()
31     endmacro()
32     macro(install_and_copy_without_extension)
33     foreach(file IN ITEMS ${ARGN})
34     string(REGEX REPLACE "\\.[^.]*$" "" file_we ${file})
35     install(PROGRAMS "${file}"
36     DESTINATION "bin"
37     RENAME ${file_we}
38 greg 1.2 )
39 greg 1.7 file(COPY "${file}" DESTINATION "${CMAKE_BINARY_DIR}/bin")
40     file(RENAME "${CMAKE_BINARY_DIR}/bin/${file}" "${CMAKE_BINARY_DIR}/bin/${file_we}")
41     endforeach()
42 greg 1.2 endmacro()
43 greg 1.1 add_subdirectory(common)
44     add_subdirectory(cal)
45     add_subdirectory(cv)
46     add_subdirectory(gen)
47     add_subdirectory(hd)
48     add_subdirectory(meta)
49     add_subdirectory(ot)
50     add_subdirectory(px)
51     add_subdirectory(rt)
52     add_subdirectory(util)
53 greg 1.7 if(NOT BUILD_HEADLESS AND Qt5Widgets_DIR)
54 greg 1.6 # only use qtrvu if qt5 is found
55 greg 1.7 add_subdirectory(qtrvu)
56 greg 1.1 endif()