--- ray/src/hd/CMakeLists.txt 2011/10/22 22:38:10 1.1 +++ ray/src/hd/CMakeLists.txt 2023/11/22 17:12:58 1.9 @@ -1,12 +1,3 @@ -set(VERSION_FILE "${radiance_BINARY_DIR}/src/hd/Version.c") -add_custom_command( - OUTPUT "${VERSION_FILE}" - COMMAND "${CMAKE_COMMAND}" - -DVERSION_OUT_FILE="${VERSION_FILE}" - -DVERSION_IN_FILE="${radiance_SOURCE_DIR}/src/util/VERSION" - -P "${radiance_SOURCE_DIR}/src/common/create_version.cmake" -) - add_executable(genrhgrid genrhgrid.c holo.c) target_link_libraries(genrhgrid rtrad) @@ -15,16 +6,82 @@ target_link_libraries(rhcopy rtrad) add_executable(rhinfo rhinfo.c holo.c holofile.c) target_link_libraries(rhinfo rtrad) -if(NOT WIN32) - add_executable(rholo rholo.c rholo2.c rholo2l.c rholo3.c rholo4.c holo.c - holofile.c viewbeams.c ${VERSION_FILE}) + +if(UNIX) + set(VERSION_FILE "${radiance_BINARY_DIR}/src/hd/Version.c") + create_version_file("${VERSION_FILE}") + add_library(version OBJECT "${VERSION_FILE}") + + add_executable(rholo + holo.c + holofile.c + rholo.c + rholo2.c + rholo2l.c + rholo3.c + rholo4.c + viewbeams.c + $ + ) target_link_libraries(rholo rtrad) + add_executable(rhoptimize rhoptimize.c clumpbeams.c holo.c holofile.c) target_link_libraries(rhoptimize rtrad) + add_executable(rhpict - rhpict.c rhpict2.c holo.c holofile.c viewbeams.c ${VERSION_FILE}) + holo.c + holofile.c + rhpict.c + rhpict2.c + viewbeams.c + $ + ) target_link_libraries(rhpict rtrad) - install(TARGETS rholo rhoptimize rhpict RUNTIME DESTINATION bin) + + install(TARGETS rholo rhoptimize rhpict + RUNTIME DESTINATION "bin" + ) + + if(X11_FOUND) + add_executable(x11.hdi + holo.c + rhd_ctab.c + rhd_qtree.c + rhd_qtree2r.c + rhd_x11.c + rhdisp.c + rhdisp2.c + viewbeams.c + ) + target_link_libraries(x11.hdi rtrad ${X11_LIBRARIES}) + + if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + target_link_libraries(x11.hdi rt) + endif() + install(TARGETS x11.hdi + RUNTIME DESTINATION "bin/dev" + ) + + if(OPENGL_FOUND) + add_executable(ogl.hdi + rhd_ogl.c + rhdisp.c + rhdisp2.c + viewbeams.c + rhd_odraw.c + rhd_geom.c + holo.c) + target_link_libraries( + ogl.hdi rgl rtrad ${X11_LIBRARIES} ${OPENGL_LIBRARIES}) + install(TARGETS ogl.hdi + RUNTIME DESTINATION "bin/dev" + ) + endif() + + endif() + endif() -install(TARGETS genrhgrid rhcopy RUNTIME DESTINATION bin) +install(TARGETS genrhgrid rhcopy rhinfo + RUNTIME DESTINATION "bin" +)