Skip to content

Commit

Permalink
Fix bug in CMakeLists.txt (get_filename_component was using non-exist…
Browse files Browse the repository at this point in the history
…ent path as BASE_DIR), use ip@5: if available instead of sp
  • Loading branch information
climbfuji committed Oct 7, 2024
1 parent f0fbb34 commit be05d12
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ list(REMOVE_DUPLICATES CAPS)

# Schemes and caps from the CCPP code generator use full paths with symlinks
# resolved, we need to do the same here for the below logic to work
get_filename_component(FULL_PATH_TO_CMAKELISTS CMakeLists.txt REALPATH BASE_DIR ${LOCAL_CURRENT_SOURCE_DIR})
get_filename_component(FULL_PATH_TO_CMAKELISTS CMakeLists.txt REALPATH)
get_filename_component(LOCAL_CURRENT_SOURCE_DIR ${FULL_PATH_TO_CMAKELISTS} DIRECTORY)

#------------------------------------------------------------------------------
Expand Down Expand Up @@ -185,8 +185,12 @@ set_target_properties(ccpp_physics PROPERTIES VERSION ${PROJECT_VERSION}
target_include_directories(ccpp_physics PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)

if(ip_FOUND)
target_link_libraries(ccpp_physics PUBLIC ip::ip_d)
else()
target_link_libraries(ccpp_physics PUBLIC sp::sp_d)
endif()
target_link_libraries(ccpp_physics PUBLIC w3emc::w3emc_d
sp::sp_d
NetCDF::NetCDF_Fortran)

# Define where to install the library
Expand Down

0 comments on commit be05d12

Please sign in to comment.