Skip to content

Commit

Permalink
get HDF5 before MOAB
Browse files Browse the repository at this point in the history
  • Loading branch information
bam241 committed Dec 5, 2024
1 parent 0c64420 commit 8761cb8
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions cmake/FindMOAB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,6 @@ find_path(MOAB_CMAKE_CONFIG
NO_DEFAULT_PATH
)

# First check if we are forcing the download of MOAB
if (DDL_INSTALL_DEPS)
IF(DAGMC_BUILD_STATIC_LIBS)
message(FATAL_ERROR "DDL_INSTALL_DEPS is ONLY compatible with shared libraries.")
ENDIF()
IF(NOT MOAB_VERSION)
SET(MOAB_VERSION "5.5.1")
ENDIF()
include(MOAB_PullAndMake)
moab_pull_make(${MOAB_VERSION})

# Back to normal behavior
elseif (MOAB_CMAKE_CONFIG)
set(MOAB_CMAKE_CONFIG ${MOAB_CMAKE_CONFIG}/MOABConfig.cmake)
message(STATUS "MOAB_CMAKE_CONFIG: ${MOAB_CMAKE_CONFIG}")
include(${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
set(ENV{PATH} "${HDF5_DIR}:$ENV{PATH}")
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
Expand All @@ -54,6 +33,28 @@ message(STATUS "HDF5_LIBRARIES_SHARED: ${HDF5_LIBRARIES_SHARED}")
message(STATUS "HDF5_LIBRARIES_STATIC: ${HDF5_LIBRARIES_STATIC}")

include_directories(${HDF5_INCLUDE_DIRS})

# First check if we are forcing the download of MOAB
if (DDL_INSTALL_DEPS)
IF(DAGMC_BUILD_STATIC_LIBS)
message(FATAL_ERROR "DDL_INSTALL_DEPS is ONLY compatible with shared libraries.")
ENDIF()
IF(NOT MOAB_VERSION)
SET(MOAB_VERSION "5.5.1")
ENDIF()
include(MOAB_PullAndMake)
moab_pull_make(${MOAB_VERSION})

# Back to normal behavior
elseif (MOAB_CMAKE_CONFIG)
set(MOAB_CMAKE_CONFIG ${MOAB_CMAKE_CONFIG}/MOABConfig.cmake)
message(STATUS "MOAB_CMAKE_CONFIG: ${MOAB_CMAKE_CONFIG}")
include(${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 ()

if(MSVC)
set(BUILD_STATIC_LIBS TRUE)
set(BUILD_SHARED_LIBS OFF)
Expand Down

0 comments on commit 8761cb8

Please sign in to comment.