From 6ff0433435292a3442fcd2fdc73a218cc0f39b97 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 26 Sep 2017 16:16:41 +0200 Subject: [PATCH] Got rid of false warning for empty opm_common_DIR. --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26aee9fe..d0363df5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,11 +42,10 @@ if(SIBLING_SEARCH AND NOT opm-common_DIR) set(opm-common_DIR "${_parent_full_dir}/opm-common}") endif() endif() -else() - if(NOT IS_DIRECTORY ${opm-common_DIR}) - message(WARNING "Value ${opm-common_DIR} passed to variable" - " opm-common_DIR is not a directory") - endif() +endif() +if(opm-common_DIR AND NOT IS_DIRECTORY ${opm-common_DIR}) + message(WARNING "Value ${opm-common_DIR} passed to variable" + " opm-common_DIR is not a directory") endif() find_package(opm-common REQUIRED)