Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Make the distrib.
[simgrid.git] / buildtools / CPACK / src / CMakeDistrib.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 set(simgrid_version "3.3.5")
4
5 set(CMAKE_PROJECT_NAME "${PROJECT_NAME}")
6 set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
7 set(CPACK_PROJECT_NAME "${PROJECT_NAME}")
8 set(CPACK_PACKAGE_FILE_NAME "simgrid-${simgrid_version}_rev_${SVN_VERSION}")
9 set(CPACK_GENERATOR "TBZ2") #;TGZ;TZ;ZIP
10
11 if(distrib)
12
13 set(to_svg      
14         ${XBT_RL_SRC}
15         ${EXTRA_DIST}
16         ${SMPI_SRC}
17         ${JMSG_C_SRC}
18         ${JMSG_JAVA_SRC}
19         ${GRAS_RL_SRC}
20         ${XBT_SRC}
21         ${GTNETS_SRC}
22         ${SURF_SRC}
23         ${SIMIX_SRC}
24         ${MSG_SRC}
25         ${SIMDAG_SRC}
26         ${GRAS_COMMON_SRC}
27         ${GRAS_SG_SRC}
28         ${AMOK_SRC}
29         ${LUA_SRC}
30         ${RUBY_SRC}
31         ${add_src_files}
32         ${include_files}
33         ${xml_files}
34         ${PROJECT_DIRECTORY}/./CMakeLists.txt
35         ${PROJECT_DIRECTORY}/./AUTHORS
36         ${PROJECT_DIRECTORY}/./ChangeLog
37         ${PROJECT_DIRECTORY}/./COPYING
38         ${PROJECT_DIRECTORY}/./missing
39         ${PROJECT_DIRECTORY}/./NEWS
40         ${PROJECT_DIRECTORY}/./README
41         ${PROJECT_DIRECTORY}/./README.IEEE
42         ${PROJECT_DIRECTORY}/./TODO
43         )
44         
45         foreach(file ${to_svg})
46                 get_filename_component(file_location ${file} PATH)
47                 string(REPLACE "${PROJECT_DIRECTORY}/" "/" file_location ${file_location})
48                 #message("install: ${file}\nDESTINATION: ${file_location}")
49                 install(FILES ${file} DESTINATION "${file_location}")
50         endforeach(file ${EXTRA_DIST})
51
52         ###copy doc
53         install(DIRECTORY "${PROJECT_DIRECTORY}/doc/"
54         DESTINATION "doc/"
55         PATTERN ".svn" EXCLUDE 
56         PATTERN ".git" EXCLUDE 
57         PATTERN "*~" EXCLUDE
58         )
59
60         ###buildtools 
61         install(DIRECTORY "${PROJECT_DIRECTORY}/buildtools/CPACK/"
62         DESTINATION "buildtools/CPACK/"
63         PATTERN ".svn" EXCLUDE 
64         PATTERN ".git" EXCLUDE 
65         PATTERN "*~" EXCLUDE
66         )
67         set(CPACK_SET_DESTDIR on)
68         set(CMAKE_INSTALL_PREFIX .)
69
70 endif(distrib)
71
72 if(NOT distrib)
73         
74         ###install libs
75         install(DIRECTORY "${PROJECT_DIRECTORY}/src/.libs/"
76         DESTINATION "lib/"
77         )
78
79         ###install include
80         install(
81         DIRECTORY "${PROJECT_DIRECTORY}/include/" 
82         DESTINATION "include/" 
83         PATTERN ".svn" EXCLUDE 
84         PATTERN ".git" EXCLUDE 
85         PATTERN "*~" EXCLUDE
86         )
87
88         ###install doc
89         install(
90         DIRECTORY "${PROJECT_DIRECTORY}/doc/html/" 
91         DESTINATION "doc/simgrid/html" 
92         )       
93         set(CPACK_SET_DESTDIR on)
94         set(CMAKE_INSTALL_PREFIX ${prefix})
95
96 endif(NOT distrib)
97
98 include(CPack)