From 8decb213d399357a794cdfad9c7617c93879be4e Mon Sep 17 00:00:00 2001 From: q-posev Date: Mon, 26 Sep 2022 17:06:04 +0200 Subject: [PATCH] Do not rely on the .git folder for TREXIO_DEVEL setup This poses issues when packaging for Guix and Debian --- .devel | 0 CMakeLists.txt | 2 +- configure.ac | 8 ++++---- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 .devel diff --git a/.devel b/.devel new file mode 100644 index 0000000..e69de29 diff --git a/CMakeLists.txt b/CMakeLists.txt index faf56bd..ef4165f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ set(CMAKE_C_STANDARD_REQUIRED ON) # Optional configure for developer mode to generate source code from org-mode files. option(TREXIO_DEVEL "TREXIO developer mode (for code generation)." OFF) -if(EXISTS "${CMAKE_SOURCE_DIR}/.git/config") +if(EXISTS "${CMAKE_SOURCE_DIR}/.devel") set(TREXIO_DEVEL ON) find_package(Python3 REQUIRED) if(Python3_FOUND) diff --git a/configure.ac b/configure.ac index 3d312f6..7751427 100644 --- a/configure.ac +++ b/configure.ac @@ -16,11 +16,11 @@ AM_PROG_AR LT_PREREQ([2.2]) LT_INIT -# Activate developer mode when the source is the git repository. +# Activate developer mode if a dummy file is present (true when cloning the git repository). # Otherwise, it is the source distribution and the developer mode should not be activated. -TEST_IFEXISTS=".git" -AC_CHECK_FILE([$TEST_IFEXISTS], - [enable_maintainer_mode="yes"], +TEST_IFEXISTS=".devel" +AS_IF([test -f $TEST_IFEXISTS], + [enable_maintainer_mode="yes"] ) VERSION_MAJOR=`echo ${PACKAGE_VERSION} | cut -d. -f1`