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.1 by greg, Sat Oct 22 22:38:10 2011 UTC vs.
Revision 1.12 by greg, Fri Apr 18 20:51:49 2014 UTC

# Line 5 | Line 5 | enable_testing()
5   include(CTest)
6  
7   option(BUILD_SHARED_LIBS "Build radiance using shared libraries?" OFF)
8 + option(BUILD_HEADLESS "Build radiance without any GUI components?" OFF)
9  
10 + option(CPACK_NREL_SUPPORT "Include OpenStudio ToolFinder Help?" OFF)
11 +
12 + if( CPACK_NREL_SUPPORT )
13 +  # find git so we can query for the current git tag
14 +  find_program(git git)
15 +  if (NOT git)
16 +    message(ERROR "Please specify the path to the git executable")
17 +  endif()
18 +
19 +  # call git log to get output containing the tag
20 +  execute_process(
21 +    COMMAND ${git} describe --tag --exact-match
22 +    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
23 +    OUTPUT_VARIABLE git_tag_output)
24 +
25 +  # create & install the source version .txt file
26 +  file(WRITE "NREL_ver.txt" "Radiance version ${git_tag_output}")
27 +  install(FILES NREL_ver.txt DESTINATION bin/..)
28 + endif()
29 +
30   if(NOT WIN32)
31 <  set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1)
31 >  set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1)
32 >  install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/man/ DESTINATION man)
33 >  set(qt_plugin_term "PLUGIN")
34   endif()
35 < set(CPACK_PACKAGING_INSTALL_PREFIX "/")
36 < set(CPACK_PACKAGE_VERSION_MAJOR 0)
37 < set(CPACK_PACKAGE_VERSION_MINOR 1)
38 < set(CPACK_PACKAGE_VERSION_PATCH 3)
39 < set(CPACK_PACKAGE_INSTALL_DIRECTORY "Radiance ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
40 < SET(CPACK_RESOURCE_FILE_WELCOME "${radiance_SOURCE_DIR}/welcome.txt")
41 < SET(CPACK_RESOURCE_FILE_README "${radiance_SOURCE_DIR}/readme.txt")
42 < SET(CPACK_RESOURCE_FILE_LICENSE "${radiance_SOURCE_DIR}/license.txt")
35 >
36 > if (WIN32)
37 >  set(CPACK_NSIS_MODIFY_PATH 1)
38 >  set(qt_plugin_term "LIBRARY")
39 >
40 >  # Set RAYPATH on install
41 >  set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS
42 >    "WriteRegExpandStr HKLM \\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\" RAYPATH '\\\$INSTDIR\\\\lib\\\;.'"
43 >  )
44 >
45 >  # Unset RAYPATH on uninstall
46 >  set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS
47 >    "DeleteRegValue HKLM \\\"SYSTEM\\\\CurrentControlSet\\\\Control\\\\Session Manager\\\\Environment\\\" RAYPATH"
48 >  )
49 > endif()
50 >
51 > if(UNIX)
52 >  set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local/radiance")
53 >  add_definitions(-Dlinux -D_FILE_OFFSET_BITS=64 -DNOSTEREO)
54 > else()
55 >  set(CPACK_PACKAGING_INSTALL_PREFIX "/")
56 > endif()
57 >
58 > if(APPLE)
59 >  add_definitions(-DBSD -DNOSTEREO -Dfreebsd)
60 >  include_directories(/usr/X11R6/include)
61 >  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.6")
62 > endif()
63 >
64 > IF( BUILD_PACKAGE )
65 >  INCLUDE(radianceCPack.cmake )
66 > ENDIF( BUILD_PACKAGE )
67 >
68 > set(CPACK_PACKAGE_VERSION_MAJOR 4)
69 > set(CPACK_PACKAGE_VERSION_MINOR 2)
70 > set(CPACK_PACKAGE_VERSION_PATCH a)
71 > set(CPACK_PACKAGE_INSTALL_DIRECTORY "Radiance")
72 > SET(CPACK_RESOURCE_FILE_WELCOME "${radiance_SOURCE_DIR}/Welcome.txt")
73 > SET(CPACK_RESOURCE_FILE_README "${radiance_SOURCE_DIR}/README.txt")
74 > SET(CPACK_RESOURCE_FILE_LICENSE "${radiance_SOURCE_DIR}/License.txt")
75 >
76 >
77   include(CPack)
78  
79 < find_package(Qt4 COMPONENTS QtCore QtGui)
79 > if(NOT BUILD_HEADLESS)
80 >  find_package(Qt4 COMPONENTS QtCore QtGui)
81 >  find_package(X11)
82 > endif()
83  
84   SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
85  
# Line 35 | Line 95 | endif()
95  
96   add_subdirectory("src")
97  
38 #download and extract radiance support files
39 include(ExternalProject)
40 set(base "${CMAKE_BINARY_DIR}/Downloads")
41 set_property(DIRECTORY PROPERTY EP_BASE ${base})
42 ExternalProject_Add(radiance_support
43  URL http://www.radiance-online.org/software/non-cvs/rad4R0supp.tar.gz
44  URL_MD5 123e3e40af59c8b246e1fdbf0661e877
45  CONFIGURE_COMMAND ""
46  BUILD_COMMAND ""
47  INSTALL_COMMAND ""
48 )
49
50 #install support files.
51 set(lib_dir ${base}/Source/radiance_support/lib)
98   set(test_dir ${CMAKE_CURRENT_SOURCE_DIR}/test/test\ data)
99 + option(BUILD_TESTING "Download support tarball & enable testing?" ON)
100 +
101 + if(BUILD_TESTING)
102 +  #download and extract radiance support files
103 +  include(ExternalProject)
104 +  set(base "${CMAKE_BINARY_DIR}/Downloads")
105 +  set_property(DIRECTORY PROPERTY EP_BASE ${base})
106 +  ExternalProject_Add(radiance_support
107 +    URL http://www.radiance-online.org/software/non-cvs/rad4R1supp.tar.gz
108 +    URL_MD5 efd82970e1d0747eede8eb64c01048f4
109 +    CONFIGURE_COMMAND ""
110 +    BUILD_COMMAND ""
111 +    INSTALL_COMMAND ""
112 +  )
113 +
114 +  #install support files.
115 +  set(lib_dir ${base}/Source/radiance_support/lib)
116 +  install(
117 +    FILES
118 +      ${lib_dir}/Earth.cal ${lib_dir}/He.cal ${lib_dir}/He3.cal
119 +      ${lib_dir}/adobe.cal ${lib_dir}/ball.cal ${lib_dir}/brick.cal
120 +      ${lib_dir}/brickweave.cal ${lib_dir}/carpet.cal ${lib_dir}/climit.cal
121 +      ${lib_dir}/corrug.cal ${lib_dir}/covelight.cal ${lib_dir}/cyl.cal
122 +      ${lib_dir}/dichroic.cal ${lib_dir}/dirt.cal ${lib_dir}/fisheye.cal
123 +      ${lib_dir}/fishgeom.cal ${lib_dir}/fprism.cal ${lib_dir}/globe.cal
124 +      ${lib_dir}/gloss.cal ${lib_dir}/grating.cal ${lib_dir}/jigglepic.cal
125 +      ${lib_dir}/lcp0.cal ${lib_dir}/limit.cal ${lib_dir}/marble.cal
126 +      ${lib_dir}/orange.cal ${lib_dir}/picture.cal ${lib_dir}/plink.cal
127 +      ${lib_dir}/prism.cal ${lib_dir}/retrorefl.cal ${lib_dir}/serraglaze.cal
128 +      ${lib_dir}/slate.cal ${lib_dir}/surf.cal ${lib_dir}/tim1.cal
129 +      ${lib_dir}/weave.cal ${lib_dir}/winxmit.cal ${lib_dir}/woodpat.cal
130 +      ${lib_dir}/woodtex.cal ${lib_dir}/wrinkle.cal
131 +      ${lib_dir}/page1.txt ${lib_dir}/page2.txt
132 +      ${lib_dir}/Pix.fnt
133 +      ${lib_dir}/PixOblique.fnt
134 +      ${lib_dir}/Veerdana.fnt
135 +      ${lib_dir}/VeerdanaBold.fnt
136 +      ${lib_dir}/VeerdanaBoldItalic.fnt
137 +      ${lib_dir}/VeerdanaItalic.fnt
138 +      ${lib_dir}/helvet.fnt
139 +      ${lib_dir}/hexbit4x1.fnt
140 +      ${test_dir}/model.oct
141 +      ${test_dir}/model.vp
142 +    DESTINATION lib
143 +  )
144 +
145 +  install(FILES ${lib_dir}/Earth.hdr DESTINATION lib RENAME Earth.pic)
146 +  install(FILES ${lib_dir}/EarthBig.hdr DESTINATION lib RENAME EarthBig.pic)
147 +  install(FILES ${lib_dir}/alberta.hdr DESTINATION lib RENAME alberta.pic)
148 +  install(FILES ${lib_dir}/brick.hdr DESTINATION lib RENAME brick.pic)
149 +  install(FILES ${lib_dir}/brickweave.hdr DESTINATION lib RENAME brickweave.pic)
150 +  install(FILES ${lib_dir}/cabin.hdr DESTINATION lib RENAME cabin.pic)
151 +  install(FILES ${lib_dir}/forestfl.hdr DESTINATION lib RENAME forestfl.pic)
152 +  install(FILES ${lib_dir}/oakfloor.hdr DESTINATION lib RENAME oakfloor.pic)
153 +  install(FILES ${lib_dir}/pine.hdr DESTINATION lib RENAME pine.pic)
154 +  install(FILES ${lib_dir}/pinebark.hdr DESTINATION lib RENAME pinebark.pic)
155 +  install(FILES ${lib_dir}/podlife.hdr DESTINATION lib RENAME podlife.pic)
156 +  install(FILES ${lib_dir}/richgrove.hdr DESTINATION lib RENAME richgrove.pic)
157 +  install(FILES ${lib_dir}/shingle.hdr DESTINATION lib RENAME shingle.pic)
158 +  install(FILES ${lib_dir}/summercab.hdr DESTINATION lib RENAME summercab.pic)
159 +  install(FILES ${lib_dir}/tulips.hdr DESTINATION lib RENAME tulips.pic)
160 +
161 +  add_subdirectory(cmake_tests)
162 + endif()
163 +  
164   install(
165    FILES
55    ${lib_dir}/Earth.cal ${lib_dir}/He.cal ${lib_dir}/He3.cal
56    ${lib_dir}/adobe.cal ${lib_dir}/ball.cal ${lib_dir}/brick.cal
57    ${lib_dir}/brickweave.cal ${lib_dir}/carpet.cal ${lib_dir}/climit.cal
58    ${lib_dir}/corrug.cal ${lib_dir}/covelight.cal ${lib_dir}/cyl.cal
59    ${lib_dir}/dichroic.cal ${lib_dir}/dirt.cal ${lib_dir}/fisheye.cal
60    ${lib_dir}/fishgeom.cal ${lib_dir}/fprism.cal ${lib_dir}/globe.cal
61    ${lib_dir}/gloss.cal ${lib_dir}/grating.cal ${lib_dir}/jigglepic.cal
62    ${lib_dir}/lcp0.cal ${lib_dir}/limit.cal ${lib_dir}/marble.cal
63    ${lib_dir}/orange.cal ${lib_dir}/picture.cal ${lib_dir}/plink.cal
64    ${lib_dir}/prism.cal ${lib_dir}/retrorefl.cal ${lib_dir}/serraglaze.cal
65    ${lib_dir}/slate.cal ${lib_dir}/surf.cal ${lib_dir}/tim1.cal
66    ${lib_dir}/weave.cal ${lib_dir}/winxmit.cal ${lib_dir}/woodpat.cal
67    ${lib_dir}/woodtex.cal ${lib_dir}/wrinkle.cal
68    ${lib_dir}/page1.txt ${lib_dir}/page2.txt
69    ${lib_dir}/Pix.fnt
70    ${lib_dir}/PixOblique.fnt
71    ${lib_dir}/Veerdana.fnt
72    ${lib_dir}/VeerdanaBold.fnt
73    ${lib_dir}/VeerdanaBoldItalic.fnt
74    ${lib_dir}/VeerdanaItalic.fnt
75    ${lib_dir}/helvet.fnt
76    ${lib_dir}/hexbit4x1.fnt
166      ${test_dir}/model.oct
167      ${test_dir}/model.vp
168 <  DESTINATION bin
168 >  DESTINATION lib
169   )
81
82 install(FILES ${lib_dir}/Earth.hdr DESTINATION bin RENAME Earth.pic)
83 install(FILES ${lib_dir}/EarthBig.hdr DESTINATION bin RENAME EarthBig.pic)
84 install(FILES ${lib_dir}/alberta.hdr DESTINATION bin RENAME alberta.pic)
85 install(FILES ${lib_dir}/brick.hdr DESTINATION bin RENAME brick.pic)
86 install(FILES ${lib_dir}/brickweave.hdr DESTINATION bin RENAME brickweave.pic)
87 install(FILES ${lib_dir}/cabin.hdr DESTINATION bin RENAME cabin.pic)
88 install(FILES ${lib_dir}/forestfl.hdr DESTINATION bin RENAME forestfl.pic)
89 install(FILES ${lib_dir}/oakfloor.hdr DESTINATION bin RENAME oakfloor.pic)
90 install(FILES ${lib_dir}/pine.hdr DESTINATION bin RENAME pine.pic)
91 install(FILES ${lib_dir}/pinebark.hdr DESTINATION bin RENAME pinebark.pic)
92 install(FILES ${lib_dir}/podlife.hdr DESTINATION bin RENAME podlife.pic)
93 install(FILES ${lib_dir}/richgrove.hdr DESTINATION bin RENAME richgrove.pic)
94 install(FILES ${lib_dir}/shingle.hdr DESTINATION bin RENAME shingle.pic)
95 install(FILES ${lib_dir}/summercab.hdr DESTINATION bin RENAME summercab.pic)
96 install(FILES ${lib_dir}/tulips.hdr DESTINATION bin RENAME tulips.pic)
97
98 add_subdirectory(cmake_tests)
170  
171   include(InstallRequiredSystemLibraries)
172   add_subdirectory(InstallRules)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines