1 set(CMAKE_PROJECT_NAME "${PROJECT_NAME}")
2 set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
3 set(CPACK_PROJECT_NAME "${PROJECT_NAME}")
5 set(CPACK_PACKAGE_FILE_NAME "simgrid-${release_version}")
6 set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1)
7 set(CPACK_GENERATOR "") #;TGZ;TZ;ZIP
9 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-src")
10 set(CPACK_SOURCE_GENERATOR "TGZ")
11 set(CPACK_SOURCE_FILES "${to_svg}")
13 set(CPACK_SET_DESTDIR on)
14 set(CMAKE_INSTALL_PREFIX ${prefix} CACHE TYPE INTERNAL FORCE)
16 #########################################
17 ### Fill in the "make install" target ###
18 #########################################
21 if(EXISTS ${PROJECT_DIRECTORY}/doc/html/)
22 install(DIRECTORY "${PROJECT_DIRECTORY}/doc/html/"
23 DESTINATION "$ENV{DESTDIR}${prefix}/doc/simgrid/html/"
24 PATTERN ".svn" EXCLUDE
25 PATTERN ".git" EXCLUDE
29 endif(EXISTS ${PROJECT_DIRECTORY}/doc/html/)
32 install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/smpicc
33 ${CMAKE_BINARY_DIR}/bin/smpirun
34 ${CMAKE_BINARY_DIR}/bin/tesh
35 DESTINATION $ENV{DESTDIR}${prefix}/bin/)
37 install(PROGRAMS tools/MSG_visualization/colorize.pl
38 DESTINATION $ENV{DESTDIR}${prefix}/bin/
39 RENAME simgrid-colorizer)
42 install(TARGETS simgrid gras
43 LIBRARY DESTINATION $ENV{DESTDIR}${prefix}/lib/)
45 install(FILES ${CMAKE_BINARY_DIR}/lib/libsimgrid_static.a
47 DESTINATION $ENV{DESTDIR}${prefix}/lib/)
51 LIBRARY DESTINATION $ENV{DESTDIR}${prefix}/lib/)
55 foreach(file ${install_HEADERS})
56 get_filename_component(location ${file} PATH)
58 DESTINATION $ENV{DESTDIR}${prefix}/${location})
59 endforeach(file ${install_HEADERS})
62 foreach(file ${ex_to_svg})
63 string(REPLACE "${PROJECT_DIRECTORY}/examples/" "" file ${file})
64 get_filename_component(location ${file} PATH)
65 install(FILES "examples/${file}"
66 DESTINATION $ENV{DESTDIR}${prefix}/doc/simgrid/examples/${location})
67 endforeach(file ${ex_to_svg})
71 install(FILES ${CMAKE_BINARY_DIR}/simgrid.jar
72 DESTINATION $ENV{DESTDIR}${prefix}/share/)
76 add_custom_target(absolute_liblink ALL
77 COMMAND ln -sf $ENV{DESTDIR}${prefix}/lib/libsimgrid.so ${CMAKE_BINARY_DIR}/libsimgrid.so)
78 install(FILES ${CMAKE_BINARY_DIR}/libsimgrid.so
79 DESTINATION $ENV{DESTDIR}${prefix}/lib/lua/5.1
84 string(REGEX REPLACE "^.*ruby/" "" install_link_ruby "${RUBY_ARCH_DIR}")
85 install(FILES ${CMAKE_BINARY_DIR}/libsimgrid.so
86 ${PROJECT_DIRECTORY}/src/bindings/ruby/simgrid.rb
87 DESTINATION $ENV{DESTDIR}${prefix}/lib/ruby/${install_link_ruby}/)
90 ###########################################
91 ### Fill in the "make uninstall" target ###
92 ###########################################
94 add_custom_target(uninstall
95 COMMAND rm -rf ${prefix}/doc/simgrid
96 COMMAND echo "uninstall doc ok"
97 COMMAND rm -f ${uninstall_libs}
98 COMMAND echo "uninstall lib ok"
99 COMMAND rm -f ${uninstall_bins}
100 COMMAND rm -f ${prefix}/bin/simgrid_colorizer.pl
101 COMMAND echo "uninstall bin ok"
102 COMMAND rm -f ${uninstall_HEADERS}
103 COMMAND echo "uninstal include ok"
104 COMMAND rm -Rf ${prefix}/include/amok ${prefix}/include/gras ${prefix}/include/instr ${prefix}/include/msg
105 COMMAND rm -Rf ${prefix}/include/simdag ${prefix}/include/smpi ${prefix}/include/surf ${prefix}/include/xbt
106 WORKING_DIRECTORY "${prefix}"
110 add_custom_command(TARGET uninstall
111 COMMAND rm -f ${prefix}/share/simgrid.jar
112 COMMAND echo "uninstall binding java"
113 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
118 add_custom_command(TARGET uninstall
119 COMMAND echo "uninstall binding lua"
120 COMMAND rm -f ${prefix}/lib/lua/5.1/simgrid.so
121 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
126 string(REGEX REPLACE "^.*ruby/" "" install_link_ruby "${RUBY_ARCH_DIR}")
127 add_custom_command(TARGET uninstall
128 COMMAND echo "uninstall binding ruby"
129 COMMAND rm -f ${prefix}/lib/ruby/${install_link_ruby}/libsimgrid.so
130 COMMAND rm -f ${prefix}/lib/ruby/${install_link_ruby}/simgrid.rb
131 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
135 ######################################
136 ### Fill in the "make html" target ###
137 ######################################
139 add_custom_target(html
140 COMMAND echo "Make the html doc"
141 COMMAND echo "cmake -DBIBTEX2HTML=${BIBTEX2HTML} ./"
142 COMMAND cmake -DBIBTEX2HTML=${BIBTEX2HTML} ./
143 COMMAND rm -rf ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/CMakeFiles
144 COMMAND rm -f ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/CMakeCache.txt
145 COMMAND rm -f ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/cmake_install.cmake
146 COMMAND rm -f ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/Makefile
147 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc"
150 ################################################################
151 ## Build a sain "make dist" target to build a source package ###
152 ## containing only the files that I explicitely state ###
153 ## (instead of any cruft laying on my disk as CPack does) ###
154 ################################################################
155 add_custom_target(dist-dir
156 COMMAND test -e simgrid-${release_version}/ && chmod -R a+w simgrid-${release_version}/ || true
157 COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}
158 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}
161 set(dirs_in_tarball "")
162 foreach(file ${to_svg} ${txt_files})
163 # This damn prefix is still set somewhere (seems to be in subdirs)
164 string(REPLACE "${PROJECT_DIRECTORY}/" "" file ${file})
166 # Create the directory on need
167 get_filename_component(file_location ${file} PATH)
168 string(REGEX MATCH ";${file_location};" OPERATION "${dirs_in_tarball}")
170 set(dirs_in_tarball "${dirs_in_tarball};${file_location};")
173 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/${file_location}/
177 # Actually copy the file
180 COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_DIRECTORY}/${file} simgrid-${release_version}/${file_location}/
182 endforeach(file ${to_svg})
184 add_custom_target(dist
185 COMMAND ${CMAKE_COMMAND} -E tar cf simgrid-${release_version}.tar simgrid-${release_version}/
186 COMMAND gzip -9v simgrid-${release_version}.tar
187 COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}
189 add_dependencies(dist dist-dir)
191 # Allow to test the "make dist"
192 add_custom_target(distcheck
193 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/_build
194 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/_inst
196 # This stupid cmake creates a directory in source, killing the purpose of the chmod
198 COMMAND ${CMAKE_COMMAND} -E make_directory simgrid-${release_version}/CMakeFiles
199 # COMMAND chmod -R a-w simgrid-${release_version}/ # FIXME: we should pass without commenting that line
200 COMMAND chmod -R a+w simgrid-${release_version}/_build
201 COMMAND chmod -R a+w simgrid-${release_version}/_inst
202 COMMAND chmod -R a+w simgrid-${release_version}/CMakeFiles
204 COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build ${CMAKE_COMMAND} build .. -Dprefix=../_inst
205 # COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make dist-dir
206 COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make -j5 || ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make
207 COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make test -j5
208 COMMAND ${CMAKE_COMMAND} -E chdir simgrid-${release_version}/_build make clean
209 # COMMAND ${CMAKE_COMMAND} -E remove_directory simgrid-${release_version}/
211 add_dependencies(distcheck dist-dir)
213 #######################################
214 ### Fill in the "make check" target ###
215 #######################################
217 add_custom_target(check
219 #WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
222 #######################################
223 ### Fill in the "make all-clean" target ###
224 #######################################
226 add_custom_target(maintainer-clean
227 COMMAND rm -f src/config_unit.c
228 COMMAND rm -f src/cunit_unit.c
229 COMMAND rm -f src/dict_unit.c
230 COMMAND rm -f src/dynar_unit.c
231 COMMAND rm -f src/ex_unit.c
232 COMMAND rm -f src/set_unit.c
233 COMMAND rm -f src/simgrid_units_main.c
234 COMMAND rm -f src/swag_unit.c
235 COMMAND rm -f src/xbt_sha_unit.c
236 COMMAND rm -f src/xbt_str_unit.c
237 COMMAND rm -f src/xbt_strbuff_unit.c
238 COMMAND rm -f src/xbt_synchro_unit.c
239 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
242 add_custom_target(supernovae-clean
243 COMMAND rm -f src/supernovae_gras.c
244 COMMAND rm -f src/supernovae_sg.c
245 COMMAND rm -f src/supernovae_smpi.c
246 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
249 add_custom_target(doc-clean
250 COMMAND rm -f doc/all_bib.html
251 COMMAND rm -f doc/all_bib.latin1.html
252 COMMAND rm -f doc/all_bib.latin1.html.tmp
253 COMMAND rm -f doc/logcategories.sh
254 COMMAND rm -f doc/publis_core.bib
255 COMMAND rm -f doc/publis_core_bib.html
256 COMMAND rm -f doc/publis_core_bib.latin1.html
257 COMMAND rm -f doc/publis_core_bib.latin1.html.tmp
258 COMMAND rm -f doc/publis_count.html
259 COMMAND rm -f doc/publis_extern.bib
260 COMMAND rm -f doc/publis_extern_bib.html
261 COMMAND rm -f doc/publis_extern_bib.latin1.html
262 COMMAND rm -f doc/publis_extern_bib.latin1.html.tmp
263 COMMAND rm -f doc/publis_intra.bib
264 COMMAND rm -f doc/publis_intra_bib.html
265 COMMAND rm -f doc/publis_intra_bib.latin1.html
266 COMMAND rm -f doc/publis_intra_bib.latin1.html.tmp
267 COMMAND rm -f doc/tmp.realtoc
268 COMMAND rm -f doc/using_bib.html
269 COMMAND rm -f doc/using_bib.latin1.html
270 COMMAND rm -f doc/using_bib.latin1.html.tmp
271 COMMAND rm -f doc/realtoc.sh
272 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
275 add_custom_target(java-clean
276 COMMAND rm -f src/simgrid.jar
277 COMMAND rm -rf src/.classes
278 COMMAND rm -f examples/java/basic/BasicTest.class
279 COMMAND rm -f examples/java/basic/FinalizeTask.class
280 COMMAND rm -f examples/java/basic/Forwarder.class
281 COMMAND rm -f examples/java/basic/Master.class
282 COMMAND rm -f examples/java/basic/Slave.class
283 COMMAND rm -f examples/java/comm_time/CommTimeTest.class
284 COMMAND rm -f examples/java/comm_time/FinalizeTask.class
285 COMMAND rm -f examples/java/comm_time/Master.class
286 COMMAND rm -f examples/java/comm_time/Slave.class
287 COMMAND rm -f examples/java/ping_pong/PingPongTask.class
288 COMMAND rm -f examples/java/ping_pong/PingPongTest.class
289 COMMAND rm -f examples/java/ping_pong/Receiver.class
290 COMMAND rm -f examples/java/ping_pong/Sender.class
291 COMMAND rm -f examples/java/suspend/DreamMaster.class
292 COMMAND rm -f examples/java/suspend/LazyGuy.class
293 COMMAND rm -f examples/java/suspend/SuspendTest.class
294 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
297 add_custom_target(all-clean
299 COMMAND make java-clean
300 COMMAND make doc-clean
301 COMMAND make supernovae-clean
303 if(enable_maintainer_mode)
304 add_custom_command(TARGET all-clean
305 COMMAND make maintainer-clean
307 endif(enable_maintainer_mode)
309 #############################################
310 ### Fill in the "make sync-gforge" target ###
311 #############################################
313 add_custom_target(sync-gforge
314 COMMAND chmod g+rw -R doc/
315 COMMAND chmod a+rX -R doc/
316 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
317 COMMAND scp doc/index.php doc/webcruft/robots.txt scm.gforge.inria.fr:/home/groups/simgrid/htdocs/
318 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/
319 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"