Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
06401cce5f07a48c2dd701de745ca49dc29870bf
[simgrid.git] / buildtools / CPACK / 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}_rev_${SVN_VERSION}")
7 set(CPACK_GENERATOR "TBZ2") #;TGZ;TZ;ZIP
8
9 set(to_svg      
10         ${XBT_RL_SRC}
11         ${EXTRA_DIST}
12         ${SMPI_SRC}
13         ${JMSG_C_SRC}
14         ${JMSG_JAVA_SRC}
15         ${GRAS_RL_SRC}
16         ${XBT_SRC}
17         ${GTNETS_SRC}
18         ${SURF_SRC}
19         ${SIMIX_SRC}
20         ${MSG_SRC}
21         ${SIMDAG_SRC}
22         ${GRAS_COMMON_SRC}
23         ${GRAS_SG_SRC}
24         ${AMOK_SRC}
25         ${LUA_SRC}
26         ${RUBY_SRC}
27         ${add_src_files}
28         ${include_files}
29         ${xml_files}
30         ${PROJECT_DIRECTORY}/./CMakeLists.txt
31         ${PROJECT_DIRECTORY}/./AUTHORS
32         ${PROJECT_DIRECTORY}/./ChangeLog
33         ${PROJECT_DIRECTORY}/./COPYING
34         ${PROJECT_DIRECTORY}/./missing
35         ${PROJECT_DIRECTORY}/./NEWS
36         ${PROJECT_DIRECTORY}/./README
37         ${PROJECT_DIRECTORY}/./README.IEEE
38         ${PROJECT_DIRECTORY}/./TODO
39 )
40         
41 foreach(file ${to_svg})
42         get_filename_component(file_location ${file} PATH)
43         string(REPLACE "${PROJECT_DIRECTORY}/" "/" file_location ${file_location})
44         #message("install: ${file}\nDESTINATION: ${file_location}")
45         install(FILES ${file} DESTINATION "${file_location}")
46 endforeach(file ${EXTRA_DIST})
47
48 ###copy doc
49 install(DIRECTORY "${PROJECT_DIRECTORY}/doc/"
50 DESTINATION "doc/"
51 PATTERN ".svn" EXCLUDE 
52 PATTERN ".git" EXCLUDE 
53 PATTERN "*~" EXCLUDE
54 )
55
56 ###buildtools 
57 install(DIRECTORY "${PROJECT_DIRECTORY}/buildtools/CPACK/"
58 DESTINATION "buildtools/CPACK/"
59 PATTERN ".svn" EXCLUDE 
60 PATTERN ".git" EXCLUDE 
61 PATTERN "*~" EXCLUDE
62 )
63
64 set(CPACK_SET_DESTDIR on)
65 set(CMAKE_INSTALL_PREFIX ${prefix} CACHE TYPE INTERNAL FORCE)
66
67 add_custom_target(install-simgrid
68 COMMAND mkdir -p ${prefix}
69 COMMAND mkdir -p ${prefix}/lib
70 COMMAND mkdir -p ${prefix}/include
71 COMMAND mkdir -p ${prefix}/doc
72 COMMAND mkdir -p ${prefix}/doc/simgrid
73 COMMAND mkdir -p ${prefix}/doc/simgrid/html
74 COMMAND cp -rf ${PROJECT_DIRECTORY}/src/.libs/* ${prefix}/lib/
75 COMMAND echo "install lib ok"
76 COMMAND cp -rf ${PROJECT_DIRECTORY}/include/ ${prefix}
77 COMMAND echo "install include ok"
78 COMMAND cp -rf ${PROJECT_DIRECTORY}/doc/html/ ${prefix}/doc/simgrid
79 COMMAND echo "install doc ok"
80 )
81
82 add_custom_target(uninstall
83 COMMAND echo "uninstall simgrid"
84 COMMAND echo "TODO"
85 )
86
87 include(CPack)