Skip to content
Snippets Groups Projects
Commit bca30529 authored by Dominic Kempf's avatar Dominic Kempf
Browse files

[CMake] Introduce a check, whether the user runs into FS1532

With a compiler name given to CMAKE_CXX_COMPILER (instead of a path),
the name is correctly expanded on the first run of cmake, but as soon
as the buil didrectory is existent, it is for obscure reasons expanded
into ${CMAKE_BINARY_DIR}/.... To avoid having users run into this bug,
the expanded compiler variable is matched with the build directory prefix.
In that case, an error is issued.
parent c92679d8
No related branches found
No related tags found
No related merge requests found
......@@ -530,6 +530,13 @@ endmacro(dune_process_dependency_macros)
# depedencies.
# Don't forget to call finalize_dune_project afterwards.
macro(dune_project)
# check whether a compiler name instead of compiler path is given, this causes serious problems with older cmake versions.
# Unfortunately those errors only surface on a second run, when the build directory already exists. The compiler
# variable is then (for obscure reasons) expanded to ${CMAKE_BINARY_DIR}/...
if((${CMAKE_CXX_COMPILER} MATCHES "${CMAKE_BINARY_DIR}.*") AND (${CMAKE_VERSION} VERSION_LESS "3.0"))
message(FATAL_ERROR "You need to specify an absolute path to your compiler instead of just the compiler name. cmake >= 3.0 fixes this issue.")
endif()
# extract information from dune.module
dune_module_information(${CMAKE_SOURCE_DIR})
set(ProjectName "${DUNE_MOD_NAME}")
......
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