Skip to content

Commit

Permalink
CMake warning about second proj_config.h
Browse files Browse the repository at this point in the history
  • Loading branch information
mwtoews authored and kbevers committed Feb 22, 2019
1 parent 410631e commit d254155
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cmake/ProjConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit d254155

Please sign in to comment.