Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill the comments intending to explain which part of the autotools were converted...
[simgrid.git] / buildtools / Cmake / UnitTesting.cmake
1 if(PERL_EXECUTABLE)
2         
3         ADD_CUSTOM_COMMAND(
4         OUTPUT  ${PROJECT_DIRECTORY}/src/cunit_unit.c
5                         ${PROJECT_DIRECTORY}/src/ex_unit.c
6                         ${PROJECT_DIRECTORY}/src/dynar_unit.c
7                         ${PROJECT_DIRECTORY}/src/dict_unit.c
8                         ${PROJECT_DIRECTORY}/src/set_unit.c
9                         ${PROJECT_DIRECTORY}/src/swag_unit.c
10                         ${PROJECT_DIRECTORY}/src/xbt_str_unit.c
11                         ${PROJECT_DIRECTORY}/src/xbt_strbuff_unit.c
12                         ${PROJECT_DIRECTORY}/src/xbt_sha_unit.c
13                         ${PROJECT_DIRECTORY}/src/config_unit.c
14                         ${PROJECT_DIRECTORY}/src/xbt_synchro_unit.c
15                         
16         DEPENDS ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl
17                         ${PROJECT_DIRECTORY}/src/xbt/cunit.c
18                         ${PROJECT_DIRECTORY}/src/xbt/ex.c
19                         ${PROJECT_DIRECTORY}/src/xbt/dynar.c
20                         ${PROJECT_DIRECTORY}/src/xbt/dict.c
21                         ${PROJECT_DIRECTORY}/src/xbt/set.c
22                         ${PROJECT_DIRECTORY}/src/xbt/swag.c
23                         ${PROJECT_DIRECTORY}/src/xbt/xbt_str.c
24                         ${PROJECT_DIRECTORY}/src/xbt/xbt_strbuff.c
25                         ${PROJECT_DIRECTORY}/src/xbt/xbt_sha.c
26                         ${PROJECT_DIRECTORY}/src/xbt/config.c
27                         ${PROJECT_DIRECTORY}/src/xbt/xbt_synchro.c
28         
29         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/simgrid_units_main.c
30         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/cunit_unit.c
31         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/ex_unit.c
32         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/dynar_unit.c
33         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/dict_unit.c
34         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/set_unit.c
35         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/swag_unit.c
36         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/xbt_str_unit.c
37         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/xbt_strbuff_unit.c
38         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/xbt_sha_unit.c
39         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/config_unit.c
40         COMMAND ${CMAKE_COMMAND} -E remove -f ${PROJECT_DIRECTORY}/src/xbt_synchro_unit.c
41         
42         COMMAND chmod a=rwx ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl
43         
44         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/cunit.c
45         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/ex.c
46         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/dynar.c
47         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/dict.c
48         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/set.c
49         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/swag.c
50         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/xbt_str.c
51         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/xbt_strbuff.c
52         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/xbt_sha.c
53         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/config.c
54         COMMAND ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl xbt/xbt_synchro.c
55         
56         
57         WORKING_DIRECTORY ${PROJECT_DIRECTORY}/src
58         
59         COMMENT "Generating *_units files for testall..."
60         )
61         
62         add_custom_target(units_files
63                                                 DEPENDS ${PROJECT_DIRECTORY}/src/cunit_unit.c
64                                                                 ${PROJECT_DIRECTORY}/src/ex_unit.c
65                                                                 ${PROJECT_DIRECTORY}/src/dynar_unit.c
66                                                                 ${PROJECT_DIRECTORY}/src/dict_unit.c
67                                                                 ${PROJECT_DIRECTORY}/src/set_unit.c
68                                                                 ${PROJECT_DIRECTORY}/src/swag_unit.c
69                                                                 ${PROJECT_DIRECTORY}/src/xbt_str_unit.c
70                                                                 ${PROJECT_DIRECTORY}/src/xbt_strbuff_unit.c
71                                                                 ${PROJECT_DIRECTORY}/src/xbt_sha_unit.c
72                                                                 ${PROJECT_DIRECTORY}/src/config_unit.c
73                                                                 ${PROJECT_DIRECTORY}/src/xbt_synchro_unit.c
74                                                 )
75         
76 else(PERL_EXECUTABLE)
77         ADD_CUSTOM_COMMAND(
78         OUTPUT  ${PROJECT_DIRECTORY}/src/cunit_unit.c
79                         ${PROJECT_DIRECTORY}/src/ex_unit.c
80                         ${PROJECT_DIRECTORY}/src/dynar_unit.c
81                         ${PROJECT_DIRECTORY}/src/dict_unit.c
82                         ${PROJECT_DIRECTORY}/src/set_unit.c
83                         ${PROJECT_DIRECTORY}/src/swag_unit.c
84                         ${PROJECT_DIRECTORY}/src/xbt_str_unit.c
85                         ${PROJECT_DIRECTORY}/src/xbt_strbuff_unit.c
86                         ${PROJECT_DIRECTORY}/src/xbt_sha_unit.c
87                         ${PROJECT_DIRECTORY}/src/config_unit.c
88                         ${PROJECT_DIRECTORY}/src/xbt_synchro_unit.c
89                         
90         DEPENDS ${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl
91                         ${PROJECT_DIRECTORY}/src/xbt/cunit.c
92                         ${PROJECT_DIRECTORY}/src/xbt/ex.c
93                         ${PROJECT_DIRECTORY}/src/xbt/dynar.c
94                         ${PROJECT_DIRECTORY}/src/xbt/dict.c
95                         ${PROJECT_DIRECTORY}/src/xbt/set.c
96                         ${PROJECT_DIRECTORY}/src/xbt/swag.c
97                         ${PROJECT_DIRECTORY}/src/xbt/xbt_str.c
98                         ${PROJECT_DIRECTORY}/src/xbt/xbt_strbuff.c
99                         ${PROJECT_DIRECTORY}/src/xbt/xbt_sha.c
100                         ${PROJECT_DIRECTORY}/src/xbt/config.c
101                         ${PROJECT_DIRECTORY}/src/xbt/xbt_synchro.c
102                         
103         COMMAND ${CMAKE_COMMAND} message "Unit files need to be regenerated, but no Perl installed")
104 endif(PERL_EXECUTABLE)
105
106