Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
bam241 committed Dec 4, 2024
1 parent f7a78f3 commit e98d102
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cmake/DAGMC_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,4 @@ endmacro ()
macro (dagmc_install_test_file filename)
install(FILES ${filename} DESTINATION ${INSTALL_TESTS_DIR})
configure_file(${CMAKE_CURRENT_LIST_DIR}/${filename} ${CMAKE_CURRENT_BINARY_DIR}/${filename} COPYONLY)
endmacro ()
endmacro ()
25 changes: 11 additions & 14 deletions cmake/FindMOAB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ if (MOAB_CMAKE_CONFIG)
message(STATUS "MOAB_CMAKE_CONFIG: ${MOAB_CMAKE_CONFIG}")
include(${MOAB_CMAKE_CONFIG})
elseif (DDL_INSTALL_DEPS)
message(STATUS "MOAB not found, MOAB will be downloaded and built")
cmake_minimum_required(VERSION 3.18)
message(STATUS "CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}")
message(STATUS "MOAB will be downloaded and built")
include(ExternalProject)
include(GNUInstallDirs)
include(FeatureSummary)
# Configure MOAB
if(NOT MOAB_VERSION)
set(MOAB_VERSION "5.5.1")
Expand All @@ -31,7 +27,7 @@ elseif (DDL_INSTALL_DEPS)
set(MOAB_INCLUDE_DIRS "${MOAB_INSTALL_PREFIX}/include")
set(MOAB_LIBRARY_DIRS "${MOAB_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
set(MOAB_LIBRARIES_SHARED "")
ExternalProject_Add(MOAB
ExternalProject_Add(MOAB_ep
PREFIX ${MOAB_ROOT}
GIT_REPOSITORY https://bitbucket.org/fathomteam/moab.git
GIT_TAG ${MOAB_VERSION}
Expand All @@ -46,22 +42,23 @@ elseif (DDL_INSTALL_DEPS)
-DCMAKE_MACOSX_RPATH:BOOL=ON
DOWNLOAD_EXTRACT_TIMESTAMP true
BUILD_BYPRODUCTS "${MOAB_LIBRARY_DIRS}/*${CMAKE_SHARED_LIBRARY_SUFFIX}*"
# Set devel space as install prefix
INSTALL_DIR "${MOAB_INSTALL_PREFIX}"
)
add_library(MOAB INTERFACE)
# list(APPEND CMAKE_MODULE_PATH ${MOAB_LIBRARY_DIRS}/cmake)
message(STATUS "CMAKE_MODULE_PATH=${CMAKE_MODULE_PATH}")
message(STATUS "MOAB_LIBRARY_DIRS=${MOAB_LIBRARY_DIRS}")
message(STATUS "MOAB_LIBRARY_DIRS=${MOAB_LIBRARY_DIRS}")

install(DIRECTORY MOAB DESTINATION ${MOAB_INSTALL_PREFIX} FILES_MATCHING PATTERN "*${CMAKE_SHARED_LIBRARY_SUFFIX}*")
# install_dependent_library(MOAB ${MOAB_LIBRARY_DIRS})
target_include_directories(MOAB SYSTEM INTERFACE ${MOAB_INCLUDE_DIRS})
target_link_libraries(MOAB INTERFACE ${MOAB_INSTALL_PREFIX}/lib64/libMOAB.so)
add_dependencies(MOAB MOAB_ep)
install(TARGETS MOAB LIBRARY DESTINATION ${MOAB_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR})

include_directories(${MOAB_INCLUDE_DIRS})
link_directories(${MOAB_LIBRARY_DIRS})
set_package_properties(MOAB PROPERTIES
DESCRIPTION "Mesh-Oriented datABase (MOAB)"
TYPE RECOMMENDED
PURPOSE "Enables MOAB support"
)
include_directories(${EIGEN3_INCLUDE_DIRS})
else ()
message(FATAL_ERROR "Could not find MOAB. Set -DMOAB_DIR=<MOAB_DIR> when running cmake or use the $MOAB_DIR environment variable.")
endif ()
Expand Down
2 changes: 1 addition & 1 deletion src/dagmc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include_directories(${CMAKE_BINARY_DIR}/src/dagmc)

dagmc_install_library(dagmc)
add_dependencies(dagmc-shared MOAB)
target_include_directories(dagmc-shared INTERFACE $<BUILD_INTERFACE:/moab/include/moab/>)
target_link_libraries(dagmc-shared PUBLIC ${MOAB_INSTALL_PREFIX}/lib64/libMOAB.so)
add_subdirectory(tools)

if (BUILD_TESTS)
Expand Down
1 change: 0 additions & 1 deletion src/pyne/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,3 @@ if(NOT (${HDF5_VERSION} VERSION_LESS 1.12.0))

dagmc_install_library(pyne_dagmc)
add_dependencies(pyne_dagmc-shared MOAB)
target_include_directories(pyne_dagmc-shared INTERFACE $<BUILD_INTERFACE:/moab/include/>)

0 comments on commit e98d102

Please sign in to comment.