diff --git a/cmake/DAGMC_macros.cmake b/cmake/DAGMC_macros.cmake index d8373d2c4..71fe2a07d 100644 --- a/cmake/DAGMC_macros.cmake +++ b/cmake/DAGMC_macros.cmake @@ -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 () diff --git a/cmake/FindMOAB.cmake b/cmake/FindMOAB.cmake index 5497f650c..483c84b95 100644 --- a/cmake/FindMOAB.cmake +++ b/cmake/FindMOAB.cmake @@ -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= 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) diff --git a/cmake/MOAB_PullAndMake.cmake b/cmake/MOAB_PullAndMake.cmake index e068c718b..16c0594bf 100644 --- a/cmake/MOAB_PullAndMake.cmake +++ b/cmake/MOAB_PullAndMake.cmake @@ -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} @@ -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})