cmake: do not require a build from the gint tree (#15)

This commit is contained in:
Lephe 2021-05-11 08:27:24 +02:00
parent 58170b9e5b
commit 0233088565
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 6 additions and 1 deletions

View File

@ -13,7 +13,12 @@ option(GINT_KMALLOC_DEBUG "Enable debug functions for kmalloc")
set(CMAKE_INSTALL_MESSAGE LAZY)
# Generate <gint/config.h> with commit hash, version name and options
git_version_number(SHORT_HASH "GINT_GIT_HASH" TAG_RELATIVE "GINT_GIT_VERSION")
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
git_version_number(SHORT_HASH "GINT_GIT_HASH" TAG_RELATIVE "GINT_GIT_VERSION")
else()
set(GINT_GIT_HASH "")
set(GINT_GIT_VERSION "${PROJECT_VERSION}")
endif()
configure_file(include/gint/config.h.in include/gint/config.h)
set(SOURCES_COMMON