CMake fixes: Generate project.h in binary dir, fix GetVersionFromFile for use as submodule. (#193)

* Use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR for project bound version string

* marian-dev cmake fix

* Generate project.h in binary dir

* We don't want people asking about extra spaces
This commit is contained in:
Jerin Philip 2021-06-09 10:12:00 +01:00 committed by GitHub
parent 3e46e3391c
commit dc2fb3d64e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

@ -1 +1 @@
Subproject commit ad92307e0f4ab66f75b03ddc87c48d28d07757f1
Subproject commit 6087379f2ee7fb3062a82a6129ff81ca5fe56eed

View File

@ -23,7 +23,7 @@ endif()
# Get current commit SHA from git
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_VERSION_GIT_SHA
OUTPUT_STRIP_TRAILING_WHITESPACE)

View File

@ -1,6 +1,6 @@
# Generate version file
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/project_version.h.in
${CMAKE_CURRENT_SOURCE_DIR}/project_version.h @ONLY)
${CMAKE_CURRENT_BINARY_DIR}/project_version.h @ONLY)
add_library(bergamot-translator STATIC
byte_array_util.cpp