Skip to content
Snippets Groups Projects
Commit 16de7cd3 authored by Marc-Olivier Andrez's avatar Marc-Olivier Andrez
Browse files

build: enable building from a directory which is not a subdirectory of the source directory

Rationale: building `ASAP::O` from a Docker image on macOS inside a
subdirectory of the source directory can be slow because the files
inside the subdirectory are visible from macOS and macOS does not seem
to handle well when many files changed within a virtual machine. It is
therefore faster to compile from a directory that is not mounted on the
Docker image, which cannot be a subdirectory of the source directory.
parent 18bf205c
No related branches found
No related tags found
1 merge request!248build: enable building from a directory which is not a subdirectory of the source directory
Pipeline #120914 failed
......@@ -33,18 +33,22 @@ if (DEFINED ENV{CI_COMMIT_REF_NAME})
return ()
endif ()
execute_process(COMMAND git describe --tags --abbrev=0
# Enable running CMake from a directory which is not a subdirectory of
# ${CMAKE_SOURCE_DIR}. See https://git-scm.com/docs/git#Documentation/git.txt--Cltpathgt
# for more information on `git -C <path>`.
set(GIT_CMD git -C "${CMAKE_SOURCE_DIR}")
execute_process(COMMAND ${GIT_CMD} describe --tags --abbrev=0
OUTPUT_VARIABLE ASAPO_TAG
WORKING_DIRECTORY ..)
string(STRIP ${ASAPO_TAG} ASAPO_TAG)
execute_process(COMMAND git rev-parse --abbrev-ref HEAD
execute_process(COMMAND ${GIT_CMD} rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE BRANCH
WORKING_DIRECTORY ..)
string(STRIP ${BRANCH} BRANCH)
cleanup(BRANCH)
execute_process(COMMAND git rev-parse --short=10 HEAD
execute_process(COMMAND ${GIT_CMD} rev-parse --short=10 HEAD
OUTPUT_VARIABLE ASAPO_VERSION_COMMIT
WORKING_DIRECTORY ..)
string(STRIP ${ASAPO_VERSION_COMMIT} ASAPO_VERSION_COMMIT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment