aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Taves <mwtoews@gmail.com>2019-02-22 20:39:53 +1300
committerKristian Evers <kristianevers@gmail.com>2019-02-22 13:04:42 +0100
commitd2541557e49b5216ffb111639fc42c72baa841d9 (patch)
tree072c02fe6ab5a1bd58e184d5924ff1e72ca5c6d2
parent410631e5a25ae88f81545393240da86722f289f9 (diff)
downloadPROJ-d2541557e49b5216ffb111639fc42c72baa841d9.tar.gz
PROJ-d2541557e49b5216ffb111639fc42c72baa841d9.zip
CMake warning about second proj_config.h
-rw-r--r--cmake/ProjConfig.cmake10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmake/ProjConfig.cmake b/cmake/ProjConfig.cmake
index a97ea9b3..ada827ea 100644
--- a/cmake/ProjConfig.cmake
+++ b/cmake/ProjConfig.cmake
@@ -37,6 +37,14 @@ set(PACKAGE_TARNAME "proj")
set(PACKAGE_URL "https://proj4.org")
set(PACKAGE_VERSION "${${PROJECT_INTERN_NAME}_VERSION}")
-configure_file(cmake/proj_config.cmake.in src/proj_config.h)
+# check if a second proj_config.h exists (created by ./configure)
+# as this is within CMake's C_INCLUDES / CXX_INCLUDES
+set(AUTOCONF_PROJ_CONFIG_H "${CMAKE_SOURCE_DIR}/src/proj_config.h")
+if(EXISTS ${AUTOCONF_PROJ_CONFIG_H})
+ message(WARNING "Autoconf's ${AUTOCONF_PROJ_CONFIG_H} may interfere "
+ "with this CMake build. Run 'make distclean' in the "
+ "source directory before CMake's build.")
+endif()
+configure_file(cmake/proj_config.cmake.in src/proj_config.h)