From 69a603e87496dcc05cf93d1359686c23a0c43e28 Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Wed, 5 Jun 2024 10:59:41 +0000 Subject: cmake: Fix out of tree build Also remove {install,version}.hpp from source control, so they're actually generated. There may be a better way to handle this, but I'll just leave a note as a TODO for now. --- CMakeLists.txt | 8 ++++++-- src/conf/install.hpp | 30 ------------------------------ src/conf/version.hpp | 40 ---------------------------------------- 3 files changed, 6 insertions(+), 72 deletions(-) delete mode 100644 src/conf/install.hpp delete mode 100644 src/conf/version.hpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 11c58d0..a0587b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,8 +101,12 @@ set(PACKAGEDATADIR "${CMAKE_INSTALL_FULL_DATAROOTDIR}/tmwa") set(PACKAGELOCALSTATEDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/tmwa") set(PACKAGESYSCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}/tmwa") -configure_file(src/conf/install.hpp.in src/conf/install.hpp @ONLY) -configure_file(src/conf/version.hpp.in src/conf/version.hpp @ONLY) +# Generate the install.hpp and version.hpp files in the source directory. +# TODO: Is there a nicer way to handle this so we're still able to make fully +# out-of-tree builds, generating the files in the build directory, but still +# having them found by includes? +configure_file(src/conf/install.hpp.in ${CMAKE_SOURCE_DIR}/src/conf/install.hpp @ONLY) +configure_file(src/conf/version.hpp.in ${CMAKE_SOURCE_DIR}/src/conf/version.hpp @ONLY) set(conf_SOURCES ${conf_SOURCES} src/conf/install.hpp src/conf/version.hpp) # Add a shared library: libtmwa-shared.so.0 diff --git a/src/conf/install.hpp b/src/conf/install.hpp deleted file mode 100644 index 42fd125..0000000 --- a/src/conf/install.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once -// conf/install.hpp - Import configuration variables related to install. -// -// Copyright © 2014 Ben Longbons -// -// This file is part of The Mana World (Athena server) -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// just mention "fwd.hpp" to make formatter happy - -#include "conf-raw/str-PACKAGESYSCONFDIR.h" -#include "conf-raw/str-PACKAGELOCALSTATEDIR.h" -#include "conf-raw/str-PACKAGEDATADIR.h" - - -namespace tmwa -{ -} // namespace tmwa diff --git a/src/conf/version.hpp b/src/conf/version.hpp deleted file mode 100644 index df8a8b6..0000000 --- a/src/conf/version.hpp +++ /dev/null @@ -1,40 +0,0 @@ -#pragma once -// conf/version.hpp - Import configuration variables related to version. -// -// Copyright © 2013-2014 Ben Longbons -// -// This file is part of The Mana World (Athena server) -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -// just mention "fwd.hpp" to make formatter happy - -#include "conf-raw/str-VERSION_FULL.h" -#include "conf-raw/str-VERSION_HASH.h" - -#include "conf-raw/int-VERSION_MAJOR.h" -#include "conf-raw/int-VERSION_MINOR.h" -#include "conf-raw/int-VERSION_PATCH.h" -#include "conf-raw/int-VERSION_DEVEL.h" - -#include "conf-raw/str-VENDOR_NAME.h" -#include "conf-raw/int-VENDOR_POINT.h" -#include "conf-raw/str-VENDOR_SOURCE.h" - -#include "conf-raw/str-VERSION_STRING.h" - - -namespace tmwa -{ -} // namespace tmwa -- cgit v1.2.3-70-g09d2