Skip to content

Commit

Permalink
Introduced mandatory call to project in top level CMakeLists.txt
Browse files Browse the repository at this point in the history
Somehow this was never called in the OPM modules. But the CMake documentation
actually says:
"The top-level ``CMakeLists.txt`` file for a project must contain a
literal, direct call to the ``project()`` command; loading one
through the ``include()`` command is not sufficient.  If no such
call exists CMake will implicitly add one to the top that enables the
default languages (``C`` and ``CXX``).
"

Without it some variables (like CMAKE_PROJECT_NAME) are not correctly defined.
  • Loading branch information
blattms committed Sep 15, 2017
1 parent c03e87e commit 27b2bae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
# #
###########################################################################

# Mandatory call to project
project(opm-material CXX)

cmake_minimum_required (VERSION 2.8)

set( OPM_COMMON_ROOT "" CACHE PATH "Root directory containing OPM related cmake modules")
Expand Down

0 comments on commit 27b2bae

Please sign in to comment.