aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2016-03-04 09:55:40 -0800
committerMichael Mann <mmann78@netscape.net>2016-03-06 01:12:56 +0000
commit32d60ac2f55f38f2d29a57fea8be008432846367 (patch)
treeec0ce3b48844179ad5a125c8e2488af2583b0094 /CMakeLists.txt
parente86dd03d3a91b72b7cc0a9eb4a8657839a9505af (diff)
CMake: Avoid pipes and the `cut` command.
Dump the output of `git shortlog` directly to AUTHORS.git instead of piping it through `cut`. Depending on our toolchain, cmake COMMANDs might not support pipes. This appears to be the case for MSBuild. Removing the `cut` command has the added benefit of reducing our dependency on Cygwin. Pass HEAD to `git shortlog`, otherwise it doesn't return anything when run under MSBuild. Change-Id: I23e9436c007d76a700bbbc45c2772c8aba6d5749 Reviewed-on: https://code.wireshark.org/review/14349 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6ad9873d2..0a62cbda39 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2699,12 +2699,15 @@ add_custom_target(test-sh
DEPENDS ${CMAKE_SOURCE_DIR}/cmake/modules/GenerateTestSh.cmake
)
-ADD_CUSTOM_TARGET(
- gen-authors
- COMMAND git shortlog -sne | cut -c8- > ${CMAKE_SOURCE_DIR}/AUTHORS.git
- COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/generate_authors.pl ${CMAKE_SOURCE_DIR}/AUTHORS.src ${CMAKE_SOURCE_DIR}/AUTHORS.git > ${CMAKE_SOURCE_DIR}/AUTHORS
-
-)
+if (GIT_EXECUTABLE)
+ ADD_CUSTOM_TARGET(
+ gen-authors
+ COMMAND ${GIT_EXECUTABLE} --no-pager shortlog -sne HEAD > ${CMAKE_SOURCE_DIR}/AUTHORS.git
+ COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/generate_authors.pl ${CMAKE_SOURCE_DIR}/AUTHORS.src ${CMAKE_SOURCE_DIR}/AUTHORS.git > ${CMAKE_SOURCE_DIR}/AUTHORS
+ )
+else (GIT_EXECUTABLE)
+ ADD_CUSTOM_TARGET( gen-authors COMMAND ${CMAKE_COMMAND} -E echo "Git not found." )
+endif (GIT_EXECUTABLE)
set_target_properties(test-sh PROPERTIES FOLDER "Tests")