diff --git a/CMakeLists.txt b/CMakeLists.txt index eb0a5afee0ed8f4f43c66ce9bc548f311c98df00..2506f3bcfa17bad1cd64d6b5353187af7560bdcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,6 @@ +# set up project +project("dune-common" C CXX) + # general stuff cmake_minimum_required(VERSION 2.8) diff --git a/cmake/modules/DuneMacros.cmake b/cmake/modules/DuneMacros.cmake index 24bcddc01d4b2d3b6abe7014826dcec00a6dfb19..c754bbf33cbd418f8e79102584b00c56ebd43225 100644 --- a/cmake/modules/DuneMacros.cmake +++ b/cmake/modules/DuneMacros.cmake @@ -109,11 +109,18 @@ macro(dune_project) set(CMAKE_CXX_FLAGS_RELEASE "-funroll-loops -O3") set(CMAKE_C_FLAGS_RELEASE "-funroll-loops -O3") + # extract information from dune.module dune_module_information(${CMAKE_SOURCE_DIR}) set(ProjectName "${DUNE_MOD_NAME}") set(ProjectVersion "${DUNE_MOD_VERSION}") set(ProjectMaintainerEmail "${DUNE_MAINTAINER}") - project(${ProjectName} C CXX) + + # assert the project names matches + if(NOT (ProjectName STREQUAL CMAKE_PROJECT_NAME)) + message(FATAL_ERROR "Module name from dune.module does not match the name given in CMakeLists.txt.") + endif(NOT (ProjectName STREQUAL CMAKE_PROJECT_NAME)) + + # optional Fortran support include(LanguageSupport) workaround_9220(Fortran Fortran_Works) if(Fortran_Works)