Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add binaries to install.
[simgrid.git] / buildtools / Cmake / src / CMakeDistrib.txt
1 set(simgrid_version "3.4")
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/smpi" "${prefix}/bin" uninstall_bins "${install_bins}")
49 string(REPLACE "${PROJECT_DIRECTORY}/src/.libs" "${prefix}/lib" uninstall_libs "${install_libs}")
50 string(REPLACE "./" "${prefix}/" uninstall_HEADERS "${install_HEADERS}")
51
52 add_custom_target(install-simgrid
53 COMMAND mkdir -p ${prefix}
54 COMMAND mkdir -p ${prefix}/bin
55 COMMAND mkdir -p ${prefix}/lib
56 COMMAND mkdir -p ${prefix}/include
57 COMMAND mkdir -p ${prefix}/doc
58 COMMAND mkdir -p ${prefix}/doc/simgrid
59 COMMAND mkdir -p ${prefix}/doc/simgrid/html
60 COMMAND cp ${install_bins} ${prefix}/bin
61 COMMAND mv ${prefix}/bin/colorize.pl ${prefix}/bin/simgrid_colorizer.pl
62 COMMAND echo "install bin ok"
63 COMMAND cp ${install_libs} ${prefix}/lib
64 COMMAND echo "install lib ok"
65 COMMAND cp -rf ${PROJECT_DIRECTORY}/doc/html/ ${prefix}/doc/simgrid
66 COMMAND echo "install doc ok"
67 COMMAND cp --parent ${install_HEADERS} ${prefix}
68 COMMAND echo "install include ok"
69 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/"
70 )
71
72 add_custom_target(uninstall
73 COMMAND echo "uninstall simgrid"
74 COMMAND rm -rf ${prefix}/doc/simgrid
75 COMMAND echo "uninstall doc ok"
76 COMMAND rm ${uninstall_libs}
77 COMMAND echo "uninstall lib ok"
78 COMMAND rm ${uninstall_bins}
79 COMMAND echo "uninstall bin ok"
80 COMMAND rm ${uninstall_HEADERS}
81 COMMAND echo "uninstal include ok"
82 COMMAND rm -R ${prefix}/include/amok ${prefix}/include/gras ${prefix}/include/instr ${prefix}/include/msg 
83 COMMAND rm -R ${prefix}/include/simdag ${prefix}/include/smpi ${prefix}/include/surf ${prefix}/include/xbt
84 WORKING_DIRECTORY "${prefix}"
85 )
86
87 add_custom_target(html
88 COMMAND echo "Make the html doc"
89 COMMAND echo "cmake -DBIBTEX2HTML=${BIBTEX2HTML} ./"
90 COMMAND cmake -DBIBTEX2HTML=${BIBTEX2HTML} ./
91 COMMAND rm -rf ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/CMakeFiles
92 COMMAND rm ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/CMakeCache.txt
93 COMMAND rm ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/cmake_install.cmake
94 COMMAND rm ${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc/Makefile
95 WORKING_DIRECTORY "${PROJECT_DIRECTORY}/buildtools/Cmake/src/doc"
96 )
97
98 add_custom_target(dist
99 COMMAND make package
100 COMMAND rm -rf ${PROJECT_DIRECTORY}/_CPack_Packages
101 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
102 )
103 add_custom_target(distcheck
104 COMMAND make package
105 COMMAND rm -rf ${PROJECT_DIRECTORY}/_CPack_Packages
106 COMMAND tar xvf ${CPACK_PACKAGE_FILE_NAME}.tar.bz2
107 COMMAND cd ${PROJECT_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME} && cmake .
108 COMMAND cd ${PROJECT_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME} && make
109 COMMAND cd ${PROJECT_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME} && make test
110 COMMAND rm -rf ${PROJECT_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}
111 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
112 )
113
114 add_custom_target(maintainer-clean
115 COMMAND rm -f src/config_unit.c
116 COMMAND rm -f src/cunit_unit.c
117 COMMAND rm -f src/dict_unit.c
118 COMMAND rm -f src/dynar_unit.c
119 COMMAND rm -f src/ex_unit.c
120 COMMAND rm -f src/set_unit.c
121 COMMAND rm -f src/simgrid_units_main.c
122 COMMAND rm -f src/swag_unit.c
123 COMMAND rm -f src/xbt_sha_unit.c
124 COMMAND rm -f src/xbt_str_unit.c
125 COMMAND rm -f src/xbt_strbuff_unit.c
126 COMMAND rm -f src/xbt_synchro_unit.c
127 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
128 )
129
130 add_custom_target(supernovae-clean
131 COMMAND rm -f src/supernovae_gras.c
132 COMMAND rm -f src/supernovae_sg.c
133 COMMAND rm -f src/supernovae_smpi.c
134 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
135 )
136
137 add_custom_target(doc-clean
138 COMMAND rm -f doc/all_bib.html
139 COMMAND rm -f doc/all_bib.latin1.html
140 COMMAND rm -f doc/all_bib.latin1.html.tmp
141 COMMAND rm -f doc/logcategories.sh
142 COMMAND rm -f doc/publis_core.bib
143 COMMAND rm -f doc/publis_core_bib.html
144 COMMAND rm -f doc/publis_core_bib.latin1.html
145 COMMAND rm -f doc/publis_core_bib.latin1.html.tmp
146 COMMAND rm -f doc/publis_count.html
147 COMMAND rm -f doc/publis_extern.bib
148 COMMAND rm -f doc/publis_extern_bib.html
149 COMMAND rm -f doc/publis_extern_bib.latin1.html
150 COMMAND rm -f doc/publis_extern_bib.latin1.html.tmp
151 COMMAND rm -f doc/publis_intra.bib
152 COMMAND rm -f doc/publis_intra_bib.html
153 COMMAND rm -f doc/publis_intra_bib.latin1.html
154 COMMAND rm -f doc/publis_intra_bib.latin1.html.tmp
155 COMMAND rm -f doc/tmp.realtoc
156 COMMAND rm -f doc/using_bib.html
157 COMMAND rm -f doc/using_bib.latin1.html
158 COMMAND rm -f doc/using_bib.latin1.html.tmp
159 COMMAND rm -f doc/realtoc.sh
160 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
161 )
162
163 add_custom_target(java-clean
164 COMMAND rm -f src/simgrid.jar
165 COMMAND rm -rf src/.classes
166 COMMAND rm -f examples/java/basic/BasicTest.class
167 COMMAND rm -f examples/java/basic/FinalizeTask.class
168 COMMAND rm -f examples/java/basic/Forwarder.class
169 COMMAND rm -f examples/java/basic/Master.class
170 COMMAND rm -f examples/java/basic/Slave.class
171 COMMAND rm -f examples/java/comm_time/CommTimeTest.class
172 COMMAND rm -f examples/java/comm_time/FinalizeTask.class
173 COMMAND rm -f examples/java/comm_time/Master.class
174 COMMAND rm -f examples/java/comm_time/Slave.class
175 COMMAND rm -f examples/java/ping_pong/PingPongTask.class
176 COMMAND rm -f examples/java/ping_pong/PingPongTest.class
177 COMMAND rm -f examples/java/ping_pong/Receiver.class
178 COMMAND rm -f examples/java/ping_pong/Sender.class
179 COMMAND rm -f examples/java/suspend/DreamMaster.class
180 COMMAND rm -f examples/java/suspend/LazyGuy.class
181 COMMAND rm -f examples/java/suspend/SuspendTest.class
182 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
183 )
184
185 add_custom_target(all-clean
186 COMMAND make clean
187 COMMAND make java-clean
188 COMMAND make doc-clean
189 COMMAND make supernovae-clean
190 COMMAND make maintainer-clean
191 WORKING_DIRECTORY "${PROJECT_DIRECTORY}"
192 )
193 include(CPack)