]> AND Public Git Repository - simgrid.git/blobdiff - buildtools/Cmake/src/CMakeFLEXml.txt
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add files to dist.
[simgrid.git] / buildtools / Cmake / src / CMakeFLEXml.txt
index 4e6afccf656364ba7646b47835796c28bb3fb470..d5c762303515e955ecf28ed1daf64969cae8bfb0 100644 (file)
@@ -5,6 +5,7 @@ message("_______________________________________________________________________
 find_program(FLEX_EXE NAMES flex)
 find_program(FLEXML_EXE NAMES flexml)
 find_program(SED_EXE NAMES sed)
+find_program(PERL_EXE NAMES perl)
 
 message("  FLEX :      ${FLEX_EXE}")
 message("FLEXML :      ${FLEXML_EXE}")
@@ -98,37 +99,34 @@ message("")
 message("________________________________________________________________________________")
 message("________________________________________________________________________________ SG_UNIT_EXTRACTOR")
 
-exec_program("rm -f simgrid_units_main.c *_unit.c ${PROJECT_DIRECTORY}/src/simgrid_units_main.c ${PROJECT_DIRECTORY}/src/*_unit.c" "${PROJECT_DIRECTORY}/src/" OUTPUT_VARIABLE OKITOKI)
-
-#$(TEST_UNITS): $(TEST_CFILES)
-string(REPLACE ";" " " TEST_CFILES "${TEST_CFILES}")
-exec_program("${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl ${TEST_CFILES}" "${PROJECT_DIRECTORY}/src/")
-
-#@builddir@/simgrid_units_main.c: $(TEST_UNITS)
-exec_program("${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl ${PROJECT_DIRECTORY}/src/xbt/cunit.c" "${PROJECT_DIRECTORY}/src/")
-
-#clean-units:
-foreach(file ${TEST_UNITS})
-       exec_program("echo ${file}|sed -e 's|.c$$|.Po|' -e 's|[^/]*/||' -e 's|^|.deps/|'" "${PROJECT_DIRECTORY}/src/" OUTPUT_VARIABLE dep)
-        exec_program("echo \"Removing dependency tracker of ${file} (${dep} ${PROJECT_DIRECTORY}/src/${dep})\"" OUTPUT_VARIABLE OKITOKI)
-       message("${OKITOKI}")
-       exec_program("rm -vf ${dep} ${PROJECT_DIRECTORY}/src/${dep}" "${PROJECT_DIRECTORY}/src/" OUTPUT_VARIABLE OKITOKI)
-       exec_program("touch ${dep}" "${PROJECT_DIRECTORY}/src/" OUTPUT_VARIABLE OKITOKI)
-endforeach(file ${TEST_UNITS})
-
+if(PERL_EXE)
+       message("   PERL :      ${PERL_EXE}\n")
+       exec_program("rm -f simgrid_units_main.c *_unit.c ${PROJECT_DIRECTORY}/src/simgrid_units_main.c ${PROJECT_DIRECTORY}/src/*_unit.c" "${PROJECT_DIRECTORY}/src/" OUTPUT_VARIABLE OKITOKI)
+
+       #$(TEST_UNITS): $(TEST_CFILES)
+       string(REPLACE ";" " " USE_TEST_CFILES "${TEST_CFILES}")
+       exec_program("${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl ${USE_TEST_CFILES}" "${PROJECT_DIRECTORY}/src/")
+
+       #@builddir@/simgrid_units_main.c: $(TEST_UNITS)
+       exec_program("${PROJECT_DIRECTORY}/tools/sg_unit_extractor.pl ${PROJECT_DIRECTORY}/src/xbt/cunit.c" "${PROJECT_DIRECTORY}/src/")
+
+       #clean-units:
+       foreach(file ${TEST_UNITS})
+               exec_program("echo ${file}|sed -e 's|.c$$|.Po|' -e 's|[^/]*/||' -e 's|^|.deps/|'" "${PROJECT_DIRECTORY}/src/" OUTPUT_VARIABLE dep)
+               exec_program("echo \"Removing dependency tracker of ${file} (${dep} ${PROJECT_DIRECTORY}/src/${dep})\"" OUTPUT_VARIABLE OKITOKI)
+               message("${OKITOKI}")
+               exec_program("rm -vf ${dep} ${PROJECT_DIRECTORY}/src/${dep}" "${PROJECT_DIRECTORY}/src/" OUTPUT_VARIABLE OKITOKI)
+               exec_program("touch ${dep}" "${PROJECT_DIRECTORY}/src/" OUTPUT_VARIABLE OKITOKI)
+       endforeach(file ${TEST_UNITS})
+else(PERL_EXE)
+       message(FATAL_ERROR "Install perl before use maintainer mode")
+endif(PERL_EXE)
 message("")
 message("________________________________________________________________________________")
 message("________________________________________________________________________________ SG_UNIT_EXTRACTOR END")
 
-message("")
-message("________________________________________________________________________________")
-message("________________________________________________________________________________ LOOKED FILES")
 foreach(file ${SRC_TO_LOOK})
-       message("FILE : ${file}")
-       configure_file(${file} ${file} @ONLY)
+       configure_file(${file} ${file} COPYONLY)
 endforeach(file ${SRC_TO_LOOK})
-message("")
-message("________________________________________________________________________________")
-message("________________________________________________________________________________ LOOKED FILES END")
 endif(enable_maintainer_mode)