From 1571e9f6ae590e89ce623c8fe0bd8dc088d6cb9b Mon Sep 17 00:00:00 2001 From: Daniel Rosen Date: Fri, 23 Jul 2021 16:09:37 +0000 Subject: [PATCH] Fix CMake when NWM_META=1 * fix cmake reference to .nwm_version file --- trunk/NDHMS/utils/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trunk/NDHMS/utils/CMakeLists.txt b/trunk/NDHMS/utils/CMakeLists.txt index 01c87856f..56efef1fb 100644 --- a/trunk/NDHMS/utils/CMakeLists.txt +++ b/trunk/NDHMS/utils/CMakeLists.txt @@ -3,11 +3,11 @@ cmake_minimum_required (VERSION 2.8) # read version numbers for wrf_hydro_version and nwm_version from # ../.version and ../.nwm_version file (STRINGS "../.version" WRF_HYDRO_VERSION) -if (NWM_META) +if (NWM_META AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.nwm_version) file (STRINGS "../.nwm_version" NWM_VERSION) -else (NWM_META) - set(NWM_VERSION "none") -endif (NWM_META) +else (NWM_META AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.nwm_version) + set(NWM_VERSION "undefined") +endif (NWM_META AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../.nwm_version) # add the preprocessor definitions for NWM_VERSION and WRF_HYDRO_VERSION # needed to compile module_version.F