From bf54f33c43701a8cc05d80c1733b1cb07dfa4182 Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Fri, 29 Dec 2017 14:11:50 -0700 Subject: [PATCH] Allow unit tests to run with a flexible directory structure Required a change in cime (for which I'll submit a PR to master) as well as minor changes to CLM's CMakeLists.txt. --- CESM.cfg | 2 +- src/CMakeLists.txt | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CESM.cfg b/CESM.cfg index 2ac8ed208a..cba625798f 100644 --- a/CESM.cfg +++ b/CESM.cfg @@ -30,7 +30,7 @@ required = True local_path = cime protocol = git repo_url = https://github.com/CESM-Development/cime -tag = billsacks/always_glcmec_n03 +tag = billsacks/always_glcmec_n04 required = True [externals_description] diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a14c4cb18..3e4ab93151 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,7 +8,6 @@ project(clm45_tests Fortran C) include(CIME_utils) set(CLM_ROOT "..") -set(CESM_ROOT "${CLM_ROOT}/../../") # This definition is needed to avoid having ESMF depend on mpi add_definitions(-DHIDE_MPI) @@ -17,10 +16,10 @@ add_definitions(-DHIDE_MPI) # done first, so that in case of name collisions, the CLM versions take # precedence (when there are two files with the same name, the one added later # wins). -add_subdirectory(${CESM_ROOT}/cime/src/share/util csm_share) -add_subdirectory(${CESM_ROOT}/cime/src/share/unit_test_stubs/util csm_share_stubs) -add_subdirectory(${CESM_ROOT}/cime/src/share/esmf_wrf_timemgr esmf_wrf_timemgr) -add_subdirectory(${CESM_ROOT}/cime/src/drivers/mct/shr drv_share) +add_subdirectory(${CIMEROOT}/src/share/util csm_share) +add_subdirectory(${CIMEROOT}/src/share/unit_test_stubs/util csm_share_stubs) +add_subdirectory(${CIMEROOT}/src/share/esmf_wrf_timemgr esmf_wrf_timemgr) +add_subdirectory(${CIMEROOT}/src/drivers/mct/shr drv_share) # Extract just the files we need from drv_share set (drv_sources_needed_base @@ -83,11 +82,11 @@ add_dependencies(esmf_wrf_timemgr csm_share) add_dependencies(clm csm_share esmf_wrf_timemgr) # We need to look for header files here, in order to pick up shr_assert.h -include_directories(${CESM_ROOT}/cime/src/share/include) +include_directories(${CIMEROOT}/src/share/include) # And we need to look for header files here, for some include files needed by # the esmf_wrf_timemgr code -include_directories(${CESM_ROOT}/cime/src/share/esmf_wrf_timemgr) +include_directories(${CIMEROOT}/src/share/esmf_wrf_timemgr) # Tell cmake to look for libraries & mod files here, because this is where we built libraries include_directories(${CMAKE_CURRENT_BINARY_DIR})