Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
93645daa77139321420091dc056785b79f2393c8
[simgrid.git] / buildtools / Cmake / src / CMakeDistrib.txt
1 set(simgrid_version "3.3.5")
2
3 set(CMAKE_PROJECT_NAME "${PROJECT_NAME}")
4 set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
5 set(CPACK_PROJECT_NAME "${PROJECT_NAME}")
6 set(CPACK_PACKAGE_FILE_NAME "simgrid-${simgrid_version}~${SVN_VERSION}${GIT_DATE}")
7 set(CPACK_GENERATOR "TBZ2") #;TGZ;TZ;ZIP
8         
9 foreach(file ${script_to_install})
10         get_filename_component(file_location ${file} PATH)
11         string(REPLACE "${PROJECT_DIRECTORY}/" "/" file_location ${file_location})
12         install(FILES ${file} DESTINATION "${file_location}")
13 endforeach(file ${EXTRA_DIST})
14
15 foreach(file ${to_svg})
16         get_filename_component(file_location ${file} PATH)
17         string(REPLACE "${PROJECT_DIRECTORY}/" "/" file_location ${file_location})
18         install(FILES ${file} DESTINATION "${file_location}")
19 endforeach(file ${EXTRA_DIST})
20
21 foreach(file ${TEST_UNITS})
22         install(FILES src/${file} DESTINATION "/src/")
23 endforeach(file ${TEST_UNITS})
24
25 ###copy doc
26 install(DIRECTORY "${PROJECT_DIRECTORY}/doc/"
27 DESTINATION "/doc/"
28 PATTERN ".svn" EXCLUDE 
29 PATTERN ".git" EXCLUDE 
30 PATTERN "*.o" EXCLUDE
31 PATTERN "*~" EXCLUDE
32 )
33
34 ###buildtools 
35 install(DIRECTORY "${PROJECT_DIRECTORY}/buildtools/Cmake/"
36 DESTINATION "/buildtools/Cmake/"
37 PATTERN ".svn" EXCLUDE 
38 PATTERN ".git" EXCLUDE
39 PATTERN "*.o" EXCLUDE
40 PATTERN "*~" EXCLUDE
41 )
42
43 set(CPACK_SET_DESTDIR on)
44 set(CMAKE_INSTALL_PREFIX ${prefix} CACHE TYPE INTERNAL FORCE)
45
46 string(REPLACE ";" "\t" install_HEADERS "${install_HEADERS}")
47 string(REPLACE ";" "\t" install_libs "${install_libs}")
48 string(REPLACE "${PROJECT_DIRECTORY}/src/.libs" "${prefix}/lib" uninstall_libs "${install_libs}")
49 string(REPLACE "./" "${prefix}/" uninstall_HEADERS "${install_HEADERS}")
50
51 add_custom_target(install-simgrid
52 COMMAND mkdir -p ${prefix}
53 COMMAND mkdir -p ${prefix}/lib
54 COMMAND mkdir -p ${prefix}/include
55 COMMAND mkdir -p ${prefix}/doc
56 COMMAND mkdir -p ${prefix}/doc/simgrid
57 COMMAND mkdir -p ${prefix}/doc/simgrid/html
58 COMMAND cp ${install_libs} ${prefix}/lib
59 COMMAND echo "install lib ok"
60 COMMAND cp -rf ${PROJECT_DIRECTORY}/doc/html/ ${prefix}/doc/simgrid
61 COMMAND echo "install doc ok"
62 COMMAND cp --parent ${install_HEADERS} ${prefix}
63 COMMAND echo "install include ok"
64 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
65 )
66
67 add_custom_target(uninstall
68 COMMAND echo "uninstall simgrid"
69 COMMAND rm -rf ${prefix}/doc/simgrid
70 COMMAND echo "uninstall doc ok"
71 COMMAND rm ${uninstall_libs}
72 COMMAND echo "uninstall lib ok"
73 COMMAND rm ${uninstall_HEADERS}
74 COMMAND echo "uninstal include ok"
75 COMMAND rm -R ${prefix}/include/amok ${prefix}/include/gras ${prefix}/include/instr ${prefix}/include/msg 
76 COMMAND rm -R ${prefix}/include/simdag ${prefix}/include/smpi ${prefix}/include/surf ${prefix}/include/xbt
77 WORKING_DIRECTORY "${prefix}"
78 )
79
80 add_custom_target(html
81 COMMAND echo "Make the html doc"
82 COMMAND echo "cmake -DBIBTEX2HTML=${BIBTEX2HTML} ./"
83 COMMAND cmake -DBIBTEX2HTML=${BIBTEX2HTML} ./
84 COMMAND rm -rf ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/CMakeFiles
85 COMMAND rm ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/CMakeCache.txt
86 COMMAND rm ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/cmake_install.cmake
87 COMMAND rm ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/Makefile
88 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc"
89 )
90
91 add_custom_target(dist
92 COMMAND make package
93 COMMAND rm -rf ${PROJECT_DIRECTORY}/_CPack_Packages
94 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
95 )
96 add_custom_target(distcheck
97 COMMAND make package
98 COMMAND rm -rf ${PROJECT_DIRECTORY}/_CPack_Packages
99 COMMAND tar xvf ${CPACK_PACKAGE_FILE_NAME}.tar.bz2
100 COMMAND cd ${PROJECT_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME} && cmake .
101 COMMAND cd ${PROJECT_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME} && make
102 COMMAND cd ${PROJECT_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME} && make test
103 COMMAND rm -rf ${PROJECT_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}
104 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
105 )
106
107 add_custom_target(maintainer-clean
108 COMMAND rm -f src/config_unit.c
109 COMMAND rm -f src/cunit_unit.c
110 COMMAND rm -f src/dict_unit.c
111 COMMAND rm -f src/dynar_unit.c
112 COMMAND rm -f src/ex_unit.c
113 COMMAND rm -f src/set_unit.c
114 COMMAND rm -f src/simgrid_units_main.c
115 COMMAND rm -f src/swag_unit.c
116 COMMAND rm -f src/xbt_sha_unit.c
117 COMMAND rm -f src/xbt_str_unit.c
118 COMMAND rm -f src/xbt_strbuff_unit.c
119 COMMAND rm -f src/xbt_synchro_unit.c
120 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
121 )
122
123 add_custom_target(supernovae-clean
124 COMMAND rm -f src/supernovae_gras.c
125 COMMAND rm -f src/supernovae_sg.c
126 COMMAND rm -f src/supernovae_smpi.c
127 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
128 )
129
130 add_custom_target(doc-clean
131 COMMAND rm -f doc/all_bib.html
132 COMMAND rm -f doc/all_bib.latin1.html
133 COMMAND rm -f doc/all_bib.latin1.html.tmp
134 COMMAND rm -f doc/logcategories.sh
135 COMMAND rm -f doc/publis_core.bib
136 COMMAND rm -f doc/publis_core_bib.html
137 COMMAND rm -f doc/publis_core_bib.latin1.html
138 COMMAND rm -f doc/publis_core_bib.latin1.html.tmp
139 COMMAND rm -f doc/publis_count.html
140 COMMAND rm -f doc/publis_extern.bib
141 COMMAND rm -f doc/publis_extern_bib.html
142 COMMAND rm -f doc/publis_extern_bib.latin1.html
143 COMMAND rm -f doc/publis_extern_bib.latin1.html.tmp
144 COMMAND rm -f doc/publis_intra.bib
145 COMMAND rm -f doc/publis_intra_bib.html
146 COMMAND rm -f doc/publis_intra_bib.latin1.html
147 COMMAND rm -f doc/publis_intra_bib.latin1.html.tmp
148 COMMAND rm -f doc/tmp.realtoc
149 COMMAND rm -f doc/using_bib.html
150 COMMAND rm -f doc/using_bib.latin1.html
151 COMMAND rm -f doc/using_bib.latin1.html.tmp
152 COMMAND rm -f doc/realtoc.sh
153 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
154 )
155
156 add_custom_target(java-clean
157 COMMAND rm -f src/simgrid.jar
158 COMMAND rm -rf src/.classes
159 COMMAND rm -f examples/java/basic/BasicTest.class
160 COMMAND rm -f examples/java/basic/FinalizeTask.class
161 COMMAND rm -f examples/java/basic/Forwarder.class
162 COMMAND rm -f examples/java/basic/Master.class
163 COMMAND rm -f examples/java/basic/Slave.class
164 COMMAND rm -f examples/java/comm_time/CommTimeTest.class
165 COMMAND rm -f examples/java/comm_time/FinalizeTask.class
166 COMMAND rm -f examples/java/comm_time/Master.class
167 COMMAND rm -f examples/java/comm_time/Slave.class
168 COMMAND rm -f examples/java/ping_pong/PingPongTask.class
169 COMMAND rm -f examples/java/ping_pong/PingPongTest.class
170 COMMAND rm -f examples/java/ping_pong/Receiver.class
171 COMMAND rm -f examples/java/ping_pong/Sender.class
172 COMMAND rm -f examples/java/suspend/DreamMaster.class
173 COMMAND rm -f examples/java/suspend/LazyGuy.class
174 COMMAND rm -f examples/java/suspend/SuspendTest.class
175 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
176 )
177
178 add_custom_target(all-clean
179 COMMAND make clean
180 COMMAND make java-clean
181 COMMAND make doc-clean
182 COMMAND make supernovae-clean
183 COMMAND make maintainer-clean
184 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
185 )
186 include(CPack)