Skip to content

Commit

Permalink
Merge pull request #984 from LLNL/task/white238/fix_codevelop_for_new…
Browse files Browse the repository at this point in the history
…_axom

Handle new axom repo in codevelop mode
  • Loading branch information
white238 authored Aug 21, 2023
2 parents ef92950 + 8f0b32d commit a20a7c9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ install(TARGETS serac
if (SERAC_ENABLE_CODEVELOP)
# This really shouldn't be needed but it keeps getting dropped from axom.
# It certainly shouldn't go here either.
target_include_directories(axom SYSTEM PUBLIC
target_include_directories(axom SYSTEM INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/axom/src>
)

Expand Down
54 changes: 42 additions & 12 deletions cmake/thirdparty/SetupSeracThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -382,19 +382,49 @@ if (NOT SERAC_THIRD_PARTY_LIBRARIES_FOUND)
set(AXOM_FOUND TRUE CACHE BOOL "" FORCE)

# Alias axom builtin thirdparty targets under axom namespace
add_library(axom::fmt ALIAS fmt)
add_library(axom::cli11 ALIAS cli11)

# Mark the axom includes as "system" and filter unallowed directories
get_target_property(_dirs axom INTERFACE_INCLUDE_DIRECTORIES)
list(REMOVE_ITEM _dirs ${PROJECT_SOURCE_DIR})
set_property(TARGET axom
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
"${_dirs}")
set_property(TARGET axom
APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
"${_dirs}")
if(NOT TARGET axom::fmt)
add_library(axom::fmt ALIAS fmt)
endif()
if(NOT TARGET axom::cli11)
add_library(axom::cli11 ALIAS cli11)
endif()

if(NOT TARGET axom)
# New axom target case where all components have individual libraries

# Create convenience target that bundles all Axom targets (axom)
# This normally happens in axom's installed config file
add_library(axom INTERFACE IMPORTED)

set(AXOM_COMPONENTS_ENABLED
core;lumberjack;slic;slam;primal;sidre;mint;spin;inlet;klee;quest;multimat)
target_link_libraries(axom INTERFACE ${AXOM_COMPONENTS_ENABLED})

if(ENABLE_OPENMP)
target_link_libraries(axom INTERFACE openmp)
endif()

# Mark the axom includes as "system" and filter unallowed directories
get_target_property(_dirs core INTERFACE_INCLUDE_DIRECTORIES)
set_property(TARGET core
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
"${_dirs}")
set_property(TARGET core
APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
"${_dirs}")
else()
# Old axom way where there is a singular combined axom library

# Mark the axom includes as "system" and filter unallowed directories
get_target_property(_dirs axom INTERFACE_INCLUDE_DIRECTORIES)
list(REMOVE_ITEM _dirs ${PROJECT_SOURCE_DIR})
set_property(TARGET axom
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
"${_dirs}")
set_property(TARGET axom
APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
"${_dirs}")
endif()
endif()

#------------------------------------------------------------------------------
Expand Down

0 comments on commit a20a7c9

Please sign in to comment.