Skip to content

Commit

Permalink
Allow unit tests to run with a flexible directory structure
Browse files Browse the repository at this point in the history
Required a change in cime (for which I'll submit a PR to master) as well
as minor changes to CLM's CMakeLists.txt.
  • Loading branch information
billsacks committed Dec 29, 2017
1 parent 62ab381 commit bf54f33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CESM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
13 changes: 6 additions & 7 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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})
Expand Down

0 comments on commit bf54f33

Please sign in to comment.