--- ray/src/CMakeLists.txt 2011/10/22 22:38:10 1.1 +++ ray/src/CMakeLists.txt 2018/06/20 20:51:24 1.8 @@ -4,14 +4,42 @@ if(UNIX) message(FATAL_ERROR "Cannot build radiance without libm. Please set LIB_M") endif() else() - set(LIB_M ) + set(LIB_M) endif() -find_package(OpenGL) -find_package(X11) - include_directories(common) - +# create a macro to generate +macro(create_version_file version_file) + add_custom_command( + OUTPUT "${version_file}" + COMMAND "${CMAKE_COMMAND}" + -DRADIANCE_VERSION="${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_TWEAK}" + -DVERSION_OUT_FILE="${version_file}" + -DVERSION_IN_FILE="${radiance_SOURCE_DIR}/src/rt/VERSION" + -DVERSION_GOLD="${radiance_SOURCE_DIR}/src/rt/Version.c" + -P "${radiance_SOURCE_DIR}/src/rt/create_version.cmake" + ) +endmacro() +macro(install_without_extension) + foreach(file IN ITEMS ${ARGN}) + string(REGEX REPLACE "\\.[^.]*$" "" file_we ${file}) + install(PROGRAMS "${file}" + DESTINATION "bin" + RENAME "${file_we}" + ) + endforeach() +endmacro() +macro(install_and_copy_without_extension) + foreach(file IN ITEMS ${ARGN}) + string(REGEX REPLACE "\\.[^.]*$" "" file_we ${file}) + install(PROGRAMS "${file}" + DESTINATION "bin" + RENAME ${file_we} + ) + file(COPY "${file}" DESTINATION "${CMAKE_BINARY_DIR}/bin") + file(RENAME "${CMAKE_BINARY_DIR}/bin/${file}" "${CMAKE_BINARY_DIR}/bin/${file_we}") + endforeach() +endmacro() add_subdirectory(common) add_subdirectory(cal) add_subdirectory(cv) @@ -22,8 +50,7 @@ add_subdirectory(ot) add_subdirectory(px) add_subdirectory(rt) add_subdirectory(util) -# only use rvu if qt4 is found -if(QT4_FOUND) +if(NOT BUILD_HEADLESS AND Qt5Widgets_DIR) + # only use qtrvu if qt5 is found add_subdirectory(qtrvu) endif() -