Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
f56228a7362437960ac4c8bc09291e1388a8a6e6
[simgrid.git] / buildtools / Cmake / Supernovae.cmake
1 ### Make supernovae files and libs
2
3 #############################################################################
4 ### Add here every files that should not be supernovaed (generated files) ###
5 #############################################################################
6 set(simgrid_fragile_sources
7   src/simdag/sd_daxloader.c
8   src/surf/surfxml_parse.c
9   src/xbt/graphxml_parse.c
10   src/xbt/mmalloc/mm.c
11   ${GTNETS_USED}
12   )
13
14 #####################################################
15 ### END OF CONFIGURATION, NO NEED TO READ FURTHER ###
16 #####################################################
17
18 ### Rebuild the supernovae source files
19 if (enable_supernovae) # I need supernovae
20
21   # supernovae files are generated. I promise
22   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
23     PROPERTIES GENERATED true)
24   set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c
25     PROPERTIES GENERATED true)
26
27   ADD_CUSTOM_COMMAND(
28     OUTPUT   ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
29     DEPENDS  ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl ${simgrid_sources}
30     COMMAND  perl ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl --out=${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c '--fragile=${simgrid_fragile_sources}' '${simgrid_sources}'
31     WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}
32     COMMENT "Generating supernovae_sg.c"
33     )
34
35
36   ADD_CUSTOM_COMMAND(
37     OUTPUT   ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c
38     DEPENDS  ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl ${SMPI_SRC}
39     COMMAND  perl ${CMAKE_HOME_DIRECTORY}/src/mk_supernovae.pl --out=${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c  '${SMPI_SRC}'
40     WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}
41     COMMENT "Generating supernovae_smpi.c"
42     )
43
44   ### Change the content of the libraries so that it contains only supernovae+fragiles
45   set(simgrid_sources
46     ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_sg.c
47     ${simgrid_fragile_sources})
48
49   set(SMPI_SRC
50     ${CMAKE_CURRENT_BINARY_DIR}/src/supernovae_smpi.c)
51
52 endif() # I need supernovae