From 08ded2384fe720cdcc83e855ba0ce571726033fe Mon Sep 17 00:00:00 2001 From: Jim Broadus Date: Mon, 15 Mar 2021 22:34:49 -0700 Subject: [PATCH] build: Move main config from /src to /include Move /src/config.h to /include/clementine-config.h. The new name prevents conflict with 3rdparty/taglib/config.h. A stub src/config.h will remain for a transition period. This is a first step in eliminating the dependency of /ext components on /src. --- CMakeLists.txt | 8 +++++++ .../clementine-config.h.in | 6 ++--- src/CMakeLists.txt | 3 --- src/config.h | 24 +++++++++++++++++++ 4 files changed, 35 insertions(+), 6 deletions(-) rename src/config.h.in => include/clementine-config.h.in (95%) create mode 100644 src/config.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 600dc6efe..27f64fee9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,6 +192,10 @@ add_definitions(${QT_DEFINITIONS}) link_directories(${TAGLIB_LIBRARY_DIRS}) link_directories(${GSTREAMER_LIBRARY_DIRS}) +# Top level headers and generated headers +include_directories(${PROJECT_SOURCE_DIR}/include) +include_directories(${PROJECT_BINARY_DIR}/include) + include_directories(${Boost_INCLUDE_DIRS}) include_directories(${TAGLIB_INCLUDE_DIRS}) include_directories(${GSTREAMER_INCLUDE_DIRS}) @@ -475,6 +479,10 @@ if(HAVE_MOODBAR) add_subdirectory(gst/moodbar) endif() +# Global configuration +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/clementine-config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/include/clementine-config.h) + # Uninstall support configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" diff --git a/src/config.h.in b/include/clementine-config.h.in similarity index 95% rename from src/config.h.in rename to include/clementine-config.h.in index 20427754b..eb6dbfced 100644 --- a/src/config.h.in +++ b/include/clementine-config.h.in @@ -14,8 +14,8 @@ along with Clementine. If not, see . */ -#ifndef CONFIG_H_IN -#define CONFIG_H_IN +#ifndef CLEMENTINE_CONFIG_H +#define CLEMENTINE_CONFIG_H #define CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" #define CMAKE_EXECUTABLE_SUFFIX "${CMAKE_EXECUTABLE_SUFFIX}" @@ -56,4 +56,4 @@ #define USE_BUNDLE_DIR "${USE_BUNDLE_DIR}" -#endif // CONFIG_H_IN +#endif // CLEMENTINE_CONFIG_H diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5afb5b992..2d5092d5a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1243,9 +1243,6 @@ optional_source(LINUX HEADERS core/ubuntuunityhack.h ) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in - ${CMAKE_CURRENT_BINARY_DIR}/config.h) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) diff --git a/src/config.h b/src/config.h new file mode 100644 index 000000000..d07a2ad08 --- /dev/null +++ b/src/config.h @@ -0,0 +1,24 @@ +/* This file is part of Clementine. + + Clementine 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. + + Clementine 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 Clementine. If not, see . +*/ + +#ifndef DEPRECATED_CONFIG_H +#define DEPRECATED_CONFIG_H + +// Deprecated. Please include clementine-config.h directly. + +#include "clementine-config.h" + +#endif // DEPRECATED_CONFIG_H