Skip to content
Snippets Groups Projects

WIP: playground for config.h replacement

Closed Simon Praetorius requested to merge feature/separate_config_h into master
3 unresolved threads
Files
2
@@ -681,8 +681,7 @@ macro(dune_project)
include(DuneCxaDemangle)
# set include path and link path for the current project.
include_directories("${CMAKE_SOURCE_DIR}")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
include_directories("${PROJECT_SOURCE_DIR}")
# Search for MPI and set the relevant variables.
include(DuneMPI)
@@ -931,7 +930,7 @@ endif()
# install pkg-config files
create_and_install_pkconfig(${DUNE_INSTALL_LIBDIR})
if("${ARGC}" GREATER "1" AND "${ARGV0}" STREQUAL "GLOBAL_CONFIG_H")
if("${ARGC}" GREATER "1")
message(STATUS "Adding custom target for config.h generation")
dune_regenerate_config_cmake()
# add a target to generate config.h.cmake
@@ -1206,11 +1205,13 @@ macro(dune_target_add_config_header _target _scope _config_h)
install(FILES ${PROJECT_BINARY_DIR}/dune/internal/${ProjectName}.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/internal/${ProjectName}.hh)
target_precompile_headers(${_target} ${_scope}
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/dune/internal/${ProjectName}.hh>
$<INSTALL_INTERFACE:dune/internal/${ProjectName}.hh>) # does not work
# Set the generated header as precompiled-header to be automatically included
# target_precompile_headers(${_target} ${_scope}
# $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/dune/internal/${ProjectName}.hh>
# $<INSTALL_INTERFACE:dune/internal/${ProjectName}.hh>) # does not work
# target_compile_options(${_target} ${_scope}
# $<BUILD_INTERFACE:-include ${PROJECT_BINARY_DIR}/dune/internal/${ProjectName}.hh>
# $<INSTALL_INTERFACE:-include ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/dune/internal/${ProjectName}.hh>) # does not work
# force include of the generated config header
target_compile_options(${_target} ${_scope}
$<BUILD_INTERFACE:-include ${PROJECT_BINARY_DIR}/dune/internal/${ProjectName}.hh>
$<INSTALL_INTERFACE:-include ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/dune/internal/${ProjectName}.hh>) # does not work
endmacro(dune_target_add_config_header)
Loading