Skip to content

Commit

Permalink
generalyze shared lib extention
Browse files Browse the repository at this point in the history
  • Loading branch information
bam241 committed Dec 6, 2024
1 parent 615b955 commit 26abadb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmake/DAGMC_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ macro (dagmc_install_library lib_name)
# Required to ensure that MOAB is built before DAGMC and to properly link against MOAB
if(DDL_INSTALL_DEPS)
add_dependencies(${lib_name}-shared MOAB)
target_link_libraries(${lib_name}-shared PUBLIC ${MOAB_LIBRARY_DIRS}/libMOAB.so)
target_link_libraries(${lib_name}-shared PUBLIC ${MOAB_LIBRARY_DIRS}/libMOAB${CMAKE_SHARED_LIBRARY_SUFFIX})
endif()
endif ()

Expand Down
2 changes: 1 addition & 1 deletion cmake/FindMOAB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ if (DDL_INSTALL_DEPS)
# Back to normal behavior
elseif (MOAB_CMAKE_CONFIG)
set(MOAB_CMAKE_CONFIG ${MOAB_CMAKE_CONFIG}/MOABConfig.cmake)
include(${MOAB_CMAKE_CONFIG})
message(STATUS "MOAB_CMAKE_CONFIG: ${MOAB_CMAKE_CONFIG}")
else ()
message(FATAL_ERROR "Could not find MOAB. Set -DMOAB_DIR=<MOAB_DIR> when running cmake or use the $MOAB_DIR environment variable.")
endif ()

# Find HDF5
include(${MOAB_CMAKE_CONFIG})
set(ENV{PATH} "${HDF5_DIR}:$ENV{PATH}")
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
find_package(HDF5 REQUIRED)
Expand Down
3 changes: 2 additions & 1 deletion cmake/MOAB_PullAndMake.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ MACRO (moab_pull_make moab_version)
set(MOAB_INCLUDE_DIRS "${MOAB_INSTALL_PREFIX}/include")
set(MOAB_LIBRARY_DIRS "${MOAB_INSTALL_PREFIX}/lib")
message("MOAB_LIBRARY_DIRS: ${MOAB_LIBRARY_DIRS}")
MEsSAGE("CMAKE_SHARED_LIBRARY_SUFFIX: ${CMAKE_SHARED_LIBRARY_SUFFIX}")
set(MOAB_LIBRARIES_SHARED "")
ExternalProject_Add(MOAB_ep
PREFIX ${MOAB_ROOT}
Expand All @@ -32,7 +33,7 @@ MACRO (moab_pull_make moab_version)
add_library(MOAB INTERFACE)

target_include_directories(MOAB SYSTEM INTERFACE ${MOAB_INCLUDE_DIRS})
target_link_libraries(MOAB INTERFACE ${MOAB_LIBRARY_DIRS}/libMOAB.so)
target_link_libraries(MOAB INTERFACE ${MOAB_LIBRARY_DIRS}/libMOAB${CMAKE_SHARED_LIBRARY_SUFFIX})
add_dependencies(MOAB MOAB_ep)
install(TARGETS MOAB LIBRARY DESTINATION ${MOAB_LIBRARY_DIRS}
PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})
Expand Down

0 comments on commit 26abadb

Please sign in to comment.