1 set(CMAKE_INSTALL_PREFIX ${prefix} CACHE TYPE INTERNAL FORCE)
3 #########################################
4 ### Fill in the "make install" target ###
5 #########################################
8 if(EXISTS ${PROJECT_DIRECTORY}/doc/html/)
9 install(DIRECTORY "${PROJECT_DIRECTORY}/doc/html/"
10 DESTINATION "$ENV{DESTDIR}${prefix}/doc/simgrid/html/"
11 PATTERN ".svn" EXCLUDE
12 PATTERN ".git" EXCLUDE
16 endif(EXISTS ${PROJECT_DIRECTORY}/doc/html/)
19 install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/smpicc
20 ${CMAKE_BINARY_DIR}/bin/smpirun
21 ${CMAKE_BINARY_DIR}/bin/tesh
22 DESTINATION $ENV{DESTDIR}${prefix}/bin/)
24 install(PROGRAMS tools/MSG_visualization/colorize.pl
25 DESTINATION $ENV{DESTDIR}${prefix}/bin/
26 RENAME simgrid-colorizer)
29 install(TARGETS simgrid gras
30 DESTINATION $ENV{DESTDIR}${prefix}/lib/)
32 install(FILES ${CMAKE_BINARY_DIR}/lib/libsimgrid_static.a
34 DESTINATION $ENV{DESTDIR}${prefix}/lib/)
38 DESTINATION $ENV{DESTDIR}${prefix}/lib/)
42 foreach(file ${install_HEADERS})
43 get_filename_component(location ${file} PATH)
45 DESTINATION $ENV{DESTDIR}${prefix}/${location})
46 endforeach(file ${install_HEADERS})
49 foreach(file ${examples_to_install_in_doc})
50 string(REPLACE "${PROJECT_DIRECTORY}/examples/" "" file ${file})
51 get_filename_component(location ${file} PATH)
52 install(FILES "examples/${file}"
53 DESTINATION $ENV{DESTDIR}${prefix}/doc/simgrid/examples/${location})
54 endforeach(file ${examples_to_install_in_doc})
58 install(FILES ${CMAKE_BINARY_DIR}/simgrid.jar
59 DESTINATION $ENV{DESTDIR}${prefix}/share/)
63 add_custom_target(absolute_liblink ALL
64 COMMAND ${CMAKE_COMMAND} -E create_symlink $ENV{DESTDIR}${prefix}/lib/libsimgrid.so ${CMAKE_BINARY_DIR}/libsimgrid.so)
65 install(FILES ${CMAKE_BINARY_DIR}/libsimgrid.so
66 DESTINATION $ENV{DESTDIR}${prefix}/lib/lua/5.1
71 string(REGEX REPLACE "^.*ruby/" "" install_link_ruby "${RUBY_ARCH_DIR}")
72 install(FILES ${CMAKE_BINARY_DIR}/libsimgrid.so
73 ${PROJECT_DIRECTORY}/src/bindings/ruby/simgrid.rb
74 DESTINATION $ENV{DESTDIR}${prefix}/lib/ruby/${install_link_ruby}/)
77 ###########################################
78 ### Fill in the "make uninstall" target ###
79 ###########################################
81 add_custom_target(uninstall
82 COMMAND ${CMAKE_COMMAND} -E remove_directory ${prefix}/doc/simgrid
83 COMMAND ${CMAKE_COMMAND} -E echo "uninstall doc ok"
84 COMMAND ${CMAKE_COMMAND} -E remove -f ${uninstall_libs}
85 COMMAND ${CMAKE_COMMAND} -E echo "uninstall lib ok"
86 COMMAND ${CMAKE_COMMAND} -E remove -f ${uninstall_bins}
87 COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/bin/simgrid_colorizer.pl
88 COMMAND ${CMAKE_COMMAND} -E echo "uninstall bin ok"
89 COMMAND ${CMAKE_COMMAND} -E remove -f ${uninstall_HEADERS}
90 COMMAND ${CMAKE_COMMAND} -E echo "uninstal include ok"
91 COMMAND ${CMAKE_COMMAND} -E remove_directory ${prefix}/include/amok
92 COMMAND ${CMAKE_COMMAND} -E remove_directory ${prefix}/include/gras
93 COMMAND ${CMAKE_COMMAND} -E remove_directory ${prefix}/include/instr
94 COMMAND ${CMAKE_COMMAND} -E remove_directory ${prefix}/include/msg
95 COMMAND ${CMAKE_COMMAND} -E remove_directory ${prefix}/include/simdag
96 COMMAND ${CMAKE_COMMAND} -E remove_directory ${prefix}/include/smpi
97 COMMAND ${CMAKE_COMMAND} -E remove_directory ${prefix}/include/surf
98 COMMAND ${CMAKE_COMMAND} -E remove_directory ${prefix}/include/xbt
99 WORKING_DIRECTORY "${prefix}"
103 add_custom_command(TARGET uninstall
104 COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/share/simgrid.jar
105 COMMAND ${CMAKE_COMMAND} -E echo "uninstall binding java"
106 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
111 add_custom_command(TARGET uninstall
112 COMMAND ${CMAKE_COMMAND} -E echo "uninstall binding lua"
113 COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/lib/lua/5.1/simgrid.so
114 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
119 string(REGEX REPLACE "^.*ruby/" "" install_link_ruby "${RUBY_ARCH_DIR}")
120 add_custom_command(TARGET uninstall
121 COMMAND ${CMAKE_COMMAND} -E echo "uninstall binding ruby"
122 COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/lib/ruby/${install_link_ruby}/libsimgrid.so
123 COMMAND ${CMAKE_COMMAND} -E remove -f ${prefix}/lib/ruby/${install_link_ruby}/simgrid.rb
124 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
128 ######################################
129 ### Fill in the "make html" target ###
130 ######################################
132 add_custom_target(html
133 COMMAND ${CMAKE_COMMAND} -E echo "Make the html doc"
134 COMMAND ${CMAKE_COMMAND} -E echo "cmake -DBIBTEX2HTML=${BIBTEX2HTML} ./"
135 COMMAND ${CMAKE_COMMAND} -DBIBTEX2HTML=${BIBTEX2HTML} ./
136 COMMAND ${CMAKE_COMMAND} -E remove_directory ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/CMakeFiles
137 COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/CMakeCache.txt
138 COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/cmake_install.cmake
139 COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/Makefile
140 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc"
143 ################################################################
144 ## Build a sain "make dist" target to build a source package ###
145 ## containing only the files that I explicitely state ###
146 ## (instead of any cruft laying on my disk as CPack does) ###
147 ################################################################
149 ##########################################
150 ### Fill in the "make dist-dir" target ###
151 ##########################################
153 add_custom_target(dist-dir
154 COMMAND test -e simgrid-${release_version}/ && chmod -R a+w simgrid-${release_version}/ || true
155 COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}
156 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}
159 set(dirs_in_tarball "")
160 foreach(file ${source_to_pack} ${txt_files})
161 # This damn prefix is still set somewhere (seems to be in subdirs)
162 string(REPLACE "${PROJECT_DIRECTORY}/" "" file ${file})
164 # Create the directory on need
165 get_filename_component(file_location ${file} PATH)
166 string(REGEX MATCH ";${file_location};" OPERATION "${dirs_in_tarball}")
168 set(dirs_in_tarball "${dirs_in_tarball};${file_location};")
171 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/${file_location}/
175 # Actually copy the file
178 COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/${file} simgrid-${release_version}/${file_location}/
180 endforeach(file ${source_to_pack})
182 ######################################
183 ### Fill in the "make dist" target ###
184 ######################################
186 add_custom_target(dist
187 COMMAND ${CMAKE_COMMAND} -E tar cf simgrid-${release_version}.tar simgrid-${release_version}/
188 COMMAND gzip -9v simgrid-${release_version}.tar
189 COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}
191 add_dependencies(dist dist-dir)
193 ###########################################
194 ### Fill in the "make distcheck" target ###
195 ###########################################
197 # Allow to test the "make dist"
198 add_custom_target(distcheck
199 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/_build
200 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/_inst
202 # This stupid cmake creates a directory in source, killing the purpose of the chmod
204 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/CMakeFiles
205 # COMMAND chmod -R a-w simgrid-${release_version}/ # FIXME: we should pass without commenting that line
206 COMMAND chmod -R a+w simgrid-${release_version}/_build
207 COMMAND chmod -R a+w simgrid-${release_version}/_inst
208 COMMAND chmod -R a+w simgrid-${release_version}/CMakeFiles
210 COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build ${CMAKE_COMMAND} build .. -Dprefix=../_inst
211 # COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make dist-dir
212 COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make
213 COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build ctest -j5 --output-on-failure
214 COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make clean
215 # COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/
217 add_dependencies(distcheck dist-dir)
219 #######################################
220 ### Fill in the "make check" target ###
221 #######################################
223 add_custom_target(check
225 #WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
228 #######################################
229 ### Fill in the "make all-clean" target ###
230 #######################################
232 add_custom_target(maintainer-clean
233 COMMAND ${CMAKE_COMMAND} -E remove -f src/config_unit.c
234 COMMAND ${CMAKE_COMMAND} -E remove -f src/cunit_unit.c
235 COMMAND ${CMAKE_COMMAND} -E remove -f src/dict_unit.c
236 COMMAND ${CMAKE_COMMAND} -E remove -f src/dynar_unit.c
237 COMMAND ${CMAKE_COMMAND} -E remove -f src/ex_unit.c
238 COMMAND ${CMAKE_COMMAND} -E remove -f src/set_unit.c
239 COMMAND ${CMAKE_COMMAND} -E remove -f src/simgrid_units_main.c
240 COMMAND ${CMAKE_COMMAND} -E remove -f src/swag_unit.c
241 COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_sha_unit.c
242 COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_str_unit.c
243 COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_strbuff_unit.c
244 COMMAND ${CMAKE_COMMAND} -E remove -f src/xbt_synchro_unit.c
245 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
248 add_custom_target(supernovae-clean
249 COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_gras.c
250 COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_sg.c
251 COMMAND ${CMAKE_COMMAND} -E remove -f src/supernovae_smpi.c
252 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
255 add_custom_target(doc-clean
256 COMMAND ${CMAKE_COMMAND} -E remove -f doc/all_bib.html
257 COMMAND ${CMAKE_COMMAND} -E remove -f doc/all_bib.latin1.html
258 COMMAND ${CMAKE_COMMAND} -E remove -f doc/all_bib.latin1.html.tmp
259 COMMAND ${CMAKE_COMMAND} -E remove -f doc/logcategories.sh
260 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_core.bib
261 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_core_bib.html
262 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_core_bib.latin1.html
263 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_core_bib.latin1.html.tmp
264 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_count.html
265 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_extern.bib
266 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_extern_bib.html
267 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_extern_bib.latin1.html
268 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_extern_bib.latin1.html.tmp
269 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_intra.bib
270 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_intra_bib.html
271 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_intra_bib.latin1.html
272 COMMAND ${CMAKE_COMMAND} -E remove -f doc/publis_intra_bib.latin1.html.tmp
273 COMMAND ${CMAKE_COMMAND} -E remove -f doc/tmp.realtoc
274 COMMAND ${CMAKE_COMMAND} -E remove -f doc/using_bib.html
275 COMMAND ${CMAKE_COMMAND} -E remove -f doc/using_bib.latin1.html
276 COMMAND ${CMAKE_COMMAND} -E remove -f doc/using_bib.latin1.html.tmp
277 COMMAND ${CMAKE_COMMAND} -E remove -f doc/realtoc.sh
278 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
281 add_custom_target(java-clean
282 COMMAND ${CMAKE_COMMAND} -E remove -f src/simgrid.jar
283 COMMAND ${CMAKE_COMMAND} -E remove_directory src/.classes
284 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/BasicTest.class
285 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/FinalizeTask.class
286 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/Forwarder.class
287 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/Master.class
288 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/basic/Slave.class
289 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/comm_time/CommTimeTest.class
290 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/comm_time/FinalizeTask.class
291 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/comm_time/Master.class
292 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/comm_time/Slave.class
293 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/ping_pong/PingPongTask.class
294 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/ping_pong/PingPongTest.class
295 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/ping_pong/Receiver.class
296 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/ping_pong/Sender.class
297 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/suspend/DreamMaster.class
298 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/suspend/LazyGuy.class
299 COMMAND ${CMAKE_COMMAND} -E remove -f examples/java/suspend/SuspendTest.class
300 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
303 add_custom_target(all-clean
305 COMMAND make java-clean
306 COMMAND make doc-clean
307 COMMAND make supernovae-clean
309 if(enable_maintainer_mode)
310 add_custom_command(TARGET all-clean
311 COMMAND make maintainer-clean
313 endif(enable_maintainer_mode)
315 #############################################
316 ### Fill in the "make sync-gforge" target ###
317 #############################################
319 add_custom_target(sync-gforge
320 COMMAND chmod g+rw -R doc/
321 COMMAND chmod a+rX -R doc/
322 COMMAND rsync --verbose --cvs-exclude --compress --delete --delete-excluded --rsh=ssh --ignore-times --recursive --links --perms --times --omit-dir-times doc/html/ scm.gforge.inria.fr:/home/groups/simgrid/htdocs/doc/ || true
323 COMMAND scp doc/index.php doc/webcruft/robots.txt scm.gforge.inria.fr:/home/groups/simgrid/htdocs/
324 COMMAND scp doc/html/simgrid_modules2.png doc/html/simgrid_modules.png doc/webcruft/simgrid_logo.png doc/webcruft/simgrid_logo_small.png scm.gforge.inria.fr:/home/groups/simgrid/htdocs/
325 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"