Skip to content
Snippets Groups Projects
Commit 96654e29 authored by Christoph Grüninger's avatar Christoph Grüninger
Browse files

[CMake] Rename the generated config.h.cmake.

Otherwise it collides with the config.h.cmake for in-source builds.
The generated file is called config_collected.h.cmake.
Thanks to Robert for the heads-up.
parent de4d4a1f
No related branches found
No related tags found
No related merge requests found
......@@ -38,11 +38,11 @@
#
# dune_regenerate_config_cmake()
#
# Creates a new config.h.cmake file in ${CMAKE_CURRENT_BINARY_DIR) that
# Creates a new config_collected.h.cmake file in ${CMAKE_CURRENT_BINARY_DIR) that
# consists of entries from ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
# and includes non-private entries from the files config.h.cmake files
# and includes non-private entries from the files config_collected.h.cmake files
# of all dependent modules.
# Finally config.h is created from config.h.cmake.
# Finally config.h is created from config_collected.h.cmake.
#
#
# dune_add_library(<basename> [NO_EXPORT] [ADD_LIBS <lib1> [<lib2> ...]]
......@@ -689,7 +689,7 @@ endmacro(dune_project)
# create a new config.h file and overwrite the existing one
macro(dune_regenerate_config_cmake)
set(CONFIG_H_CMAKE_FILE "${CMAKE_BINARY_DIR}/config.h.cmake")
set(CONFIG_H_CMAKE_FILE "${CMAKE_BINARY_DIR}/config_collected.h.cmake")
if(EXISTS ${CMAKE_SOURCE_DIR}/config.h.cmake)
file(READ ${CMAKE_SOURCE_DIR}/config.h.cmake _file)
string(REGEX MATCH
......@@ -697,8 +697,8 @@ macro(dune_regenerate_config_cmake)
_myfile "${_file}")
endif(EXISTS ${CMAKE_SOURCE_DIR}/config.h.cmake)
# overwrite file with new content
file(WRITE ${CONFIG_H_CMAKE_FILE} "/* config.h. Generated from config.h.cmake by CMake.
It was generated from config.h.cmake which in turn is generated automatically
file(WRITE ${CONFIG_H_CMAKE_FILE} "/* config.h. Generated from config_collected.h.cmake by CMake.
It was generated from config_collected.h.cmake which in turn is generated automatically
from the config.h.cmake files of modules this module depends on. */"
)
......@@ -869,12 +869,12 @@ endif()
message(STATUS "Adding custom target for config.h generation")
dune_regenerate_config_cmake()
# add a target to generate config.h.cmake
add_custom_target(OUTPUT config.h.cmake
add_custom_target(OUTPUT config_collected.h.cmake
COMMAND dune_regenerate_config_cmake()
DEPENDS stamp-regenerate-config-h)
# actually write the config.h file to disk
# using generated file
configure_file(${CMAKE_CURRENT_BINARY_DIR}/config.h.cmake
configure_file(${CMAKE_CURRENT_BINARY_DIR}/config_collected.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config.h)
else("${ARGC}" EQUAL "1")
message(STATUS "Not adding custom target for config.h generation")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment