--- ray/src/util/CMakeLists.txt 2011/10/22 22:38:10 1.1 +++ ray/src/util/CMakeLists.txt 2018/10/15 19:12:54 1.29 @@ -1,14 +1,7 @@ set(VERSION_FILE "${radiance_BINARY_DIR}/src/util/Version.c") -add_custom_command( - OUTPUT "${VERSION_FILE}" - DEPENDS "${radiance_SOURCE_DIR}/src/util/VERSION" - 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" -) +create_version_file("${VERSION_FILE}") -add_executable(dctimestep dctimestep.c) +add_executable(dctimestep dctimestep.c cmbsdf.c cmatrix.c) target_link_libraries(dctimestep rtrad) add_executable(findglare findglare.c glareval.c glaresrc.c setscan.c) @@ -22,21 +15,19 @@ target_link_libraries(glarendx rtrad) add_executable(rad rad.c) target_link_libraries(rad rtrad) + if(WIN32) set(netproc_SOURCES win_netproc.c) else() set(netproc_SOURCES netproc.c) endif() + add_executable(ranimate ranimate.c ${netproc_SOURCES}) target_link_libraries(ranimate rtrad) add_executable(rpiece rpiece.c "${VERSION_FILE}") target_link_libraries(rpiece rtrad) -add_executable(rtcontrib - rtcontrib.c "${VERSION_FILE}") -target_link_libraries(rtcontrib rtrad) - add_executable(vwrays vwrays.c) target_link_libraries(vwrays rtrad) @@ -44,7 +35,7 @@ add_executable(vwright vwright.c) target_link_libraries(vwright rtrad) #the next few libraries all need to include header files from the rt directory -include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../rt) +include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../rt") add_executable(ranimove ranimove.c ranimove1.c ranimove2.c) target_link_libraries(ranimove raycalls radiance rtrad) @@ -52,35 +43,147 @@ target_link_libraries(ranimove raycalls radiance rtrad add_executable(rsensor rsensor.c) target_link_libraries(rsensor raycalls radiance rtrad) +add_executable(rttree_reduce rttree_reduce.c) +target_link_libraries(rttree_reduce rtrad) + +add_executable(rcollate rcollate.c) +target_link_libraries(rcollate rtrad) + +add_executable(rmtxop rmtxop.c rmatrix.c cmbsdf.c cmatrix.c) +target_link_libraries(rmtxop rtrad) + +add_executable(wrapBSDF wrapBSDF.c) +target_link_libraries(wrapBSDF rtrad) + +add_executable(eplus_adduvf eplus_adduvf.c eplus_idf.c) +target_link_libraries(eplus_adduvf rtrad) + +add_executable(rfluxmtx rfluxmtx.c) +target_link_libraries(rfluxmtx rtrad) + +add_executable(evalglare evalglare.c pictool.c) +target_link_libraries(evalglare rtrad libreetz) + +add_executable(radcompare radcompare.c) +target_link_libraries(radcompare rtrad) + if(X11_FOUND) add_executable(xglaresrc - xglaresrc.c ${CMAKE_CURRENT_SOURCE_DIR}/../common/x11findwind.c) + xglaresrc.c + "${CMAKE_CURRENT_SOURCE_DIR}/../common/x11findwind.c" + ) target_link_libraries(xglaresrc rtrad ${X11_LIBRARIES}) - install(TARGETS xglaresrc RUNTIME DESTINATION bin) + install(TARGETS xglaresrc + RUNTIME DESTINATION "bin" + ) endif() -find_library(LIB_RGL "rgl" DOC "Path to librgl") -if(LIB_RGL) - #glrad needs to be able to include OpenGL headers +#glrad needs to link against OpenGL libraries +if(APPLE) + find_library(OPENGL_gl_LIBRARY + NAMES GL MesaGL + PATHS ${X11_LIB_SEARCH_PATH} + ) + find_library(OPENGL_glu_LIBRARY + NAMES GLU MesaGLU + PATHS ${X11_LIB_SEARCH_PATH} + ) + set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) +else() + find_package(OpenGL REQUIRED) include_directories(${OPENGL_INCLUDE_DIR}) +endif() - #check if we have SGIStereo.h - find_file(HAVE_SGISTEREO_H "SGIStereo.h" ${OPENGL_INCLUDE_DIR}) - if(NOT HAVE_SGISTEREO_H) - add_definitions(-DNOSTEREO) +#check if we have SGIStereo.h +find_file(HAVE_SGISTEREO_H "SGIStereo.h" ${OPENGL_INCLUDE_DIR}) +if(NOT HAVE_SGISTEREO_H) + add_definitions(-DNOSTEREO) +endif() +if(UNIX AND X11_FOUND) + add_executable(glrad glrad.c) + target_link_libraries(glrad rgl rtrad ${OPENGL_LIBRARIES} ${X11_LIBRARIES}) + install(TARGETS glrad + RUNTIME DESTINATION "bin" + ) + if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + target_link_libraries(glrad rt) endif() +endif() - add_executable(glrad glrad.c) - target_link_libraries(glrad - rtrad ${LIB_RGL} ${OPENGL_LIBRARIES} ${X11_LIBRARIES}) - install(TARGETS glrad RUNTIME DESTINATION bin) +if(UNIX) + install(TARGETS rpiece + RUNTIME DESTINATION "bin" + ) endif() -install(TARGETS dctimestep findglare getinfo glarendx rad ranimate rpiece - rtcontrib vwrays vwright ranimove rsensor - RUNTIME DESTINATION bin) -install(FILES objview.csh objpict.csh glare.csh dayfact.csh rlux.csh - raddepend.csh trad.wsh objline.csh compamb.csh vinfo.csh - genambpos.csh fieldcomb.csh genklemsamp.pl genskyvec.pl - genBSDF.pl tregsamp.dat - DESTINATION bin) +install(TARGETS + dctimestep + eplus_adduvf + evalglare + findglare + getinfo + glarendx + rad + radcompare + ranimate + ranimove + rcollate + rfluxmtx + rmtxop + rsensor + rttree_reduce + vwrays + vwright + wrapBSDF + RUNTIME DESTINATION "bin" +) + +file(COPY + ambpos.cal + disk2square.cal + klems_full.cal + klems_half.cal + klems_quarter.cal + minimalBSDFt.xml + rambpos.cal + reinhartb.cal + tregsamp.dat + WINDOW6BSDFt.xml + DESTINATION "${CMAKE_BINARY_DIR}/lib" +) + +if(WIN32) + install(PROGRAMS + bsdfview.pl + genBSDF.pl + genklemsamp.pl + genskyvec.pl + ltpict.pl + ltview.pl + objpict.pl + objview.pl + DESTINATION "bin" + ) +else() + install_without_extension( + bsdfview.pl + compamb.csh + dayfact.csh + fieldcomb.csh + genBSDF.pl + genambpos.csh + genklemsamp.pl + genskyvec.pl + glare.csh + ltpict.pl + ltview.pl + objline.csh + objpict.pl + objview.pl + raddepend.csh + rlux.csh + rtpict.pl + trad.wsh + vinfo.csh + ) +endif()