Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/PackageHelper.cmake
Show All 17 Lines | function(exclude_git_ignored_files_from_source_package) | ||||
# Make git output a list of the ignored files and directories, and store it | # Make git output a list of the ignored files and directories, and store it | ||||
# to a file. | # to a file. | ||||
# The --porcelain option ensures the output will remain stable. | # The --porcelain option ensures the output will remain stable. | ||||
execute_process( | execute_process( | ||||
COMMAND "${GIT_EXECUTABLE}" "status" "--ignored" "--porcelain" | COMMAND "${GIT_EXECUTABLE}" "status" "--ignored" "--porcelain" | ||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | ||||
OUTPUT_VARIABLE _git_ignored_files | OUTPUT_VARIABLE _git_ignored_files | ||||
RESULT_VARIABLE _git_result | RESULT_VARIABLE _git_result | ||||
ERROR_QUIET | |||||
) | ) | ||||
# If something goes wrong with the git command, don't proceed the output. | # If something goes wrong with the git command, don't proceed the output. | ||||
if(NOT _git_result EQUAL 0) | if(NOT _git_result EQUAL 0) | ||||
return() | return() | ||||
endif() | endif() | ||||
# Parse the output line by line. | # Parse the output line by line. | ||||
Show All 38 Lines |