Rename cmake_config.h to build_config.h, and don't make it optional

In preparation for MSVC compilation support
This commit is contained in:
Rogier 2016-05-17 08:54:43 +02:00
parent 984a4e3a97
commit 82ba727a2d
5 changed files with 10 additions and 16 deletions

2
.gitignore vendored
View File

@ -6,7 +6,7 @@ CPack*
_CPack_Packages/ _CPack_Packages/
Makefile Makefile
cmake_install.cmake cmake_install.cmake
cmake_config.h build_config.h
*.deb *.deb
*.rpm *.rpm
*.tar.gz *.tar.gz

View File

@ -520,9 +520,9 @@ include(CPack)
# DO this near the end - to make sure all variables have been computed # DO this near the end - to make sure all variables have been computed
# and are final. # and are final.
set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
configure_file( configure_file(
"${PROJECT_SOURCE_DIR}/cmake_config.h.in" "${PROJECT_SOURCE_DIR}/build_config.h.in"
"${PROJECT_BINARY_DIR}/cmake_config.h" "${PROJECT_BINARY_DIR}/build_config.h"
) )
add_definitions ( -DUSE_CMAKE_CONFIG_H )

View File

@ -1,6 +1,6 @@
#include <iostream> #include <iostream>
#include "cmake_config.h" #include "build_config.h"
#include "CharEncodingConverter.h" #include "CharEncodingConverter.h"
#ifdef _WIN32 #ifdef _WIN32

View File

@ -1,7 +1,7 @@
// Filled in by the build system // Filled in by the build system
#ifndef CMAKE_CONFIG_H #ifndef BUILD_CONFIG_H
#define CMAKE_CONFIG_H #define BUILD_CONFIG_H
#define USE_SQLITE3 @USE_SQLITE3@ #define USE_SQLITE3 @USE_SQLITE3@
#define USE_POSTGRESQL @USE_POSTGRESQL@ #define USE_POSTGRESQL @USE_POSTGRESQL@
@ -14,7 +14,7 @@
#define VERSION_MINOR "@VERSION_MINOR@" #define VERSION_MINOR "@VERSION_MINOR@"
#define PACKAGING_FLAT @PACKAGING_FLAT@ #define PACKAGING_FLAT @PACKAGING_FLAT@
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" #define INSTALL_PREFIX "@INSTALL_PREFIX@"
#endif #endif

View File

@ -7,6 +7,8 @@
* ===================================================================== * =====================================================================
*/ */
#include "build_config.h"
#if MSDOS || __OS2__ || __NT__ || _WIN32 #if MSDOS || __OS2__ || __NT__ || _WIN32
#define PATH_SEPARATOR '\\' #define PATH_SEPARATOR '\\'
#else #else
@ -21,14 +23,6 @@
// Max number of node name -> color mappings stored in a mapblock // Max number of node name -> color mappings stored in a mapblock
#define MAPBLOCK_MAXCOLORS 65536 #define MAPBLOCK_MAXCOLORS 65536
#ifdef USE_CMAKE_CONFIG_H
#include "cmake_config.h"
#else
#define USE_SQLITE3 1
#define USE_LEVELDB 0
#define USE_REDIS 0
#endif
// List of possible database names (for usage message) // List of possible database names (for usage message)
#if USE_SQLITE3 #if USE_SQLITE3
#define USAGE_NAME_SQLITE "/sqlite3" #define USAGE_NAME_SQLITE "/sqlite3"