@@ -852,19 +852,41 @@ foreach(script ${git_shell_scripts})
852
852
endforeach ()
853
853
854
854
#perl scripts
855
- parse_makefile_for_scripts (git_perl_scripts "SCRIPT_PERL" ".perl " )
855
+ parse_makefile_for_scripts (git_perl_scripts "SCRIPT_PERL" "" )
856
856
857
857
#create perl header
858
858
file (STRINGS ${CMAKE_SOURCE_DIR} /perl/header_templates/fixed_prefix.template.pl perl_header )
859
859
string (REPLACE "@PATHSEP@" ":" perl_header "${perl_header} " )
860
860
string (REPLACE "@INSTLIBDIR@" "${INSTLIBDIR} " perl_header "${perl_header} " )
861
+ file (WRITE ${CMAKE_BINARY_DIR} /PERL-HEADER ${perl_header} )
862
+
863
+ add_custom_command (OUTPUT "${CMAKE_BINARY_DIR} /GIT-VERSION-FILE"
864
+ COMMAND "${SH_EXE} " "${CMAKE_SOURCE_DIR} /GIT-VERSION-GEN"
865
+ "${CMAKE_SOURCE_DIR} "
866
+ "${CMAKE_SOURCE_DIR} /GIT-VERSION-FILE.in"
867
+ "${CMAKE_BINARY_DIR} /GIT-VERSION-FILE"
868
+ DEPENDS ${SH_EXE} "${CMAKE_SOURCE_DIR} /GIT-VERSION-GEN"
869
+ "${CMAKE_SOURCE_DIR} /GIT-VERSION-FILE.in"
870
+ VERBATIM )
861
871
862
872
foreach (script ${git_perl_scripts} )
863
- file (STRINGS ${CMAKE_SOURCE_DIR} /${script}.perl content NEWLINE_CONSUME )
864
- string (REPLACE "#!/usr/bin/perl" "#!/usr/bin/perl\n ${perl_header} \n " content "${content} " )
865
- string (REPLACE "@GIT_VERSION@" "${PROJECT_VERSION} " content "${content} " )
866
- file (WRITE ${CMAKE_BINARY_DIR} /${script} ${content} )
873
+ string (REPLACE ".perl" "" perl_gen_path "${script} " )
874
+
875
+ add_custom_command (OUTPUT "${CMAKE_BINARY_DIR} /${perl_gen_path} "
876
+ COMMAND "${SH_EXE} " "${CMAKE_SOURCE_DIR} /generate-perl.sh"
877
+ "${CMAKE_BINARY_DIR} /GIT-BUILD-OPTIONS"
878
+ "${CMAKE_BINARY_DIR} /GIT-VERSION-FILE"
879
+ "${CMAKE_BINARY_DIR} /PERL-HEADER"
880
+ "${CMAKE_SOURCE_DIR} /${script} "
881
+ "${CMAKE_BINARY_DIR} /${perl_gen_path} "
882
+ DEPENDS "${CMAKE_SOURCE_DIR} /generate-perl.sh"
883
+ "${CMAKE_SOURCE_DIR} /${script} "
884
+ "${CMAKE_BINARY_DIR} /GIT-BUILD-OPTIONS"
885
+ "${CMAKE_BINARY_DIR} /GIT-VERSION-FILE"
886
+ VERBATIM )
887
+ list (APPEND perl_gen ${CMAKE_BINARY_DIR} /${perl_gen_path} )
867
888
endforeach ()
889
+ add_custom_target (perl-gen ALL DEPENDS ${perl_gen} )
868
890
869
891
#python script
870
892
file (STRINGS ${CMAKE_SOURCE_DIR} /git-p4.py content NEWLINE_CONSUME )
0 commit comments