2024-06-17 16:00:45 -05:00
|
|
|
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
2024-04-20 10:45:16 -05:00
|
|
|
project(openmc C CXX)
|
2013-11-29 13:36:06 -05:00
|
|
|
|
2021-01-18 12:37:18 -06:00
|
|
|
# Set version numbers
|
|
|
|
|
set(OPENMC_VERSION_MAJOR 0)
|
2024-06-21 20:28:56 -05:00
|
|
|
set(OPENMC_VERSION_MINOR 15)
|
2024-06-24 11:29:51 -05:00
|
|
|
set(OPENMC_VERSION_RELEASE 1)
|
2021-01-18 12:37:18 -06:00
|
|
|
set(OPENMC_VERSION ${OPENMC_VERSION_MAJOR}.${OPENMC_VERSION_MINOR}.${OPENMC_VERSION_RELEASE})
|
2022-05-09 21:20:08 +02:00
|
|
|
configure_file(include/openmc/version.h.in "${CMAKE_BINARY_DIR}/include/openmc/version.h" @ONLY)
|
2021-01-18 12:37:18 -06:00
|
|
|
|
2013-12-01 22:09:35 -05:00
|
|
|
# Setup output directories
|
|
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
|
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
|
|
|
|
|
2015-08-31 11:13:21 +07:00
|
|
|
# Set module path
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
|
|
|
|
|
|
2022-06-21 14:58:39 -05:00
|
|
|
# Enable correct usage of CXX_EXTENSIONS
|
|
|
|
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
|
|
|
|
|
cmake_policy(SET CMP0128 NEW)
|
|
|
|
|
endif()
|
|
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Command line options
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2022-03-22 14:34:26 -05:00
|
|
|
option(OPENMC_USE_OPENMP "Enable shared-memory parallelism with OpenMP" ON)
|
2023-01-13 10:47:56 -05:00
|
|
|
option(OPENMC_BUILD_TESTS "Build tests" ON)
|
2022-03-22 14:34:26 -05:00
|
|
|
option(OPENMC_ENABLE_PROFILE "Compile with profiling flags" OFF)
|
|
|
|
|
option(OPENMC_ENABLE_COVERAGE "Compile with coverage analysis flags" OFF)
|
2022-03-22 10:46:34 -05:00
|
|
|
option(OPENMC_USE_DAGMC "Enable support for DAGMC (CAD) geometry" OFF)
|
|
|
|
|
option(OPENMC_USE_LIBMESH "Enable support for libMesh unstructured mesh tallies" OFF)
|
2022-04-05 15:32:43 -05:00
|
|
|
option(OPENMC_USE_MPI "Enable MPI" OFF)
|
2022-07-15 21:35:59 +02:00
|
|
|
option(OPENMC_USE_MCPL "Enable MCPL" OFF)
|
2021-09-13 01:25:36 -03:00
|
|
|
option(OPENMC_USE_NCRYSTAL "Enable support for NCrystal scattering" OFF)
|
2024-04-24 12:05:11 -04:00
|
|
|
option(OPENMC_USE_UWUW "Enable UWUW" OFF)
|
2018-02-23 01:31:26 -06:00
|
|
|
|
2022-08-10 23:06:47 -05:00
|
|
|
# Warnings for deprecated options
|
|
|
|
|
foreach(OLD_OPT IN ITEMS "openmp" "profile" "coverage" "dagmc" "libmesh")
|
|
|
|
|
if(DEFINED ${OLD_OPT})
|
|
|
|
|
string(TOUPPER ${OLD_OPT} OPT_UPPER)
|
2022-08-11 08:05:33 -05:00
|
|
|
if ("${OLD_OPT}" STREQUAL "profile" OR "${OLD_OPT}" STREQUAL "coverage")
|
|
|
|
|
set(NEW_OPT_PREFIX "OPENMC_ENABLE")
|
|
|
|
|
else()
|
|
|
|
|
set(NEW_OPT_PREFIX "OPENMC_USE")
|
|
|
|
|
endif()
|
2022-08-10 23:06:47 -05:00
|
|
|
message(WARNING "The OpenMC CMake option '${OLD_OPT}' has been deprecated. "
|
|
|
|
|
"Its value will be ignored. "
|
2022-08-11 08:05:33 -05:00
|
|
|
"Please use '-D${NEW_OPT_PREFIX}_${OPT_UPPER}=${${OLD_OPT}}' instead.")
|
2022-08-10 23:06:47 -05:00
|
|
|
unset(${OLD_OPT} CACHE)
|
|
|
|
|
endif()
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
foreach(OLD_BLD in ITEMS "debug" "optimize")
|
|
|
|
|
if(DEFINED ${OLD_BLD})
|
2022-08-11 09:06:32 -04:00
|
|
|
if("${OLD_BLD}" STREQUAL "debug")
|
|
|
|
|
set(BLD_VAR "Debug")
|
2022-08-10 23:06:47 -05:00
|
|
|
else()
|
|
|
|
|
set(BLD_VAR "Release")
|
|
|
|
|
endif()
|
|
|
|
|
message(WARNING "The OpenMC CMake option '${OLD_BLD}' has been deprecated. "
|
|
|
|
|
"Its value will be ignored. "
|
|
|
|
|
"OpenMC now uses the CMAKE_BUILD_TYPE variable to set the build mode. "
|
|
|
|
|
"Please use '-DCMAKE_BUILD_TYPE=${BLD_VAR}' instead.")
|
|
|
|
|
unset(${OLD_BLD} CACHE)
|
|
|
|
|
endif()
|
|
|
|
|
endforeach()
|
|
|
|
|
|
2022-03-21 15:39:31 -05:00
|
|
|
#===============================================================================
|
2022-03-23 10:49:42 -05:00
|
|
|
# Set a default build configuration if not explicitly specified
|
2022-03-21 15:39:31 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
|
2022-03-23 09:53:50 -05:00
|
|
|
if(NOT CMAKE_BUILD_TYPE)
|
|
|
|
|
message(STATUS "No build type selected, defaulting to RelWithDebInfo")
|
2022-03-22 10:02:04 -05:00
|
|
|
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build" FORCE)
|
2022-03-21 15:39:31 -05:00
|
|
|
endif()
|
2022-03-21 14:07:03 -05:00
|
|
|
|
2024-04-20 00:44:40 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# OpenMP for shared-memory parallelism (and GPU support some day!)
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
|
|
if(OPENMC_USE_OPENMP)
|
|
|
|
|
find_package(OpenMP REQUIRED)
|
|
|
|
|
endif()
|
|
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
2015-08-31 11:13:21 +07:00
|
|
|
# MPI for distributed-memory parallelism
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
|
2022-04-05 15:32:43 -05:00
|
|
|
if(OPENMC_USE_MPI)
|
|
|
|
|
find_package(MPI REQUIRED)
|
2013-11-29 13:36:06 -05:00
|
|
|
endif()
|
|
|
|
|
|
2022-03-17 22:03:10 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Helper macro for finding a dependency
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
|
|
macro(find_package_write_status pkg)
|
|
|
|
|
find_package(${pkg} QUIET NO_SYSTEM_ENVIRONMENT_PATH)
|
|
|
|
|
if(${pkg}_FOUND)
|
|
|
|
|
message(STATUS "Found ${pkg}: ${${pkg}_DIR} (version ${${pkg}_VERSION})")
|
|
|
|
|
else()
|
|
|
|
|
message(STATUS "Did not find ${pkg}, will use submodule instead")
|
|
|
|
|
endif()
|
|
|
|
|
endmacro()
|
|
|
|
|
|
2021-09-13 01:25:36 -03:00
|
|
|
#===============================================================================
|
|
|
|
|
# NCrystal Scattering Support
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
|
|
if(OPENMC_USE_NCRYSTAL)
|
2022-09-26 11:19:54 +02:00
|
|
|
find_package(NCrystal REQUIRED)
|
2022-10-20 11:36:22 +02:00
|
|
|
message(STATUS "Found NCrystal: ${NCrystal_DIR} (version ${NCrystal_VERSION})")
|
2021-09-13 01:25:36 -03:00
|
|
|
endif()
|
|
|
|
|
|
2018-02-23 00:26:31 -06:00
|
|
|
#===============================================================================
|
2018-09-21 15:48:50 -04:00
|
|
|
# DAGMC Geometry Support - need DAGMC/MOAB
|
2018-02-23 00:26:31 -06:00
|
|
|
#===============================================================================
|
2022-03-17 22:03:10 -05:00
|
|
|
|
2022-03-22 10:46:34 -05:00
|
|
|
if(OPENMC_USE_DAGMC)
|
2020-04-08 09:36:18 -05:00
|
|
|
find_package(DAGMC REQUIRED PATH_SUFFIXES lib/cmake)
|
2021-05-13 13:22:40 -05:00
|
|
|
if (${DAGMC_VERSION} VERSION_LESS 3.2.0)
|
2024-04-24 12:05:11 -04:00
|
|
|
message(FATAL_ERROR "Discovered DAGMC Version: ${DAGMC_VERSION}."
|
|
|
|
|
"Please update DAGMC to version 3.2.0 or greater.")
|
2021-05-13 13:22:40 -05:00
|
|
|
endif()
|
2023-10-30 07:29:28 -05:00
|
|
|
message(STATUS "Found DAGMC: ${DAGMC_DIR} (version ${DAGMC_VERSION})")
|
2024-04-24 12:05:11 -04:00
|
|
|
|
|
|
|
|
# Check if UWUW is needed and available
|
|
|
|
|
if(OPENMC_USE_UWUW AND NOT DAGMC_BUILD_UWUW)
|
|
|
|
|
message(FATAL_ERROR "UWUW is enabled but DAGMC was not configured with UWUW.")
|
|
|
|
|
endif()
|
2018-02-23 00:26:31 -06:00
|
|
|
endif()
|
|
|
|
|
|
2019-12-05 22:29:47 -06:00
|
|
|
#===============================================================================
|
|
|
|
|
# libMesh Unstructured Mesh Support
|
|
|
|
|
#===============================================================================
|
2022-03-17 22:03:10 -05:00
|
|
|
|
2022-03-22 10:46:34 -05:00
|
|
|
if(OPENMC_USE_LIBMESH)
|
2019-12-05 22:29:47 -06:00
|
|
|
find_package(LIBMESH REQUIRED)
|
2021-02-10 12:28:20 -05:00
|
|
|
endif()
|
2021-02-06 16:24:05 -05:00
|
|
|
|
2021-09-30 16:28:05 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# libpng
|
|
|
|
|
#===============================================================================
|
2022-03-17 22:03:10 -05:00
|
|
|
|
2021-09-30 16:28:05 -05:00
|
|
|
find_package(PNG)
|
|
|
|
|
|
2015-08-31 11:13:21 +07:00
|
|
|
#===============================================================================
|
|
|
|
|
# HDF5 for binary output
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
|
|
# Unfortunately FindHDF5.cmake will always prefer a serial HDF5 installation
|
|
|
|
|
# over a parallel installation if both appear on the user's PATH. To get around
|
|
|
|
|
# this, we check for the environment variable HDF5_ROOT and if it exists, use it
|
|
|
|
|
# to check whether its a parallel version.
|
|
|
|
|
|
2017-07-10 14:55:16 -05:00
|
|
|
if(NOT DEFINED HDF5_PREFER_PARALLEL)
|
|
|
|
|
if(DEFINED ENV{HDF5_ROOT} AND EXISTS $ENV{HDF5_ROOT}/bin/h5pcc)
|
|
|
|
|
set(HDF5_PREFER_PARALLEL TRUE)
|
|
|
|
|
else()
|
|
|
|
|
set(HDF5_PREFER_PARALLEL FALSE)
|
|
|
|
|
endif()
|
2015-08-31 11:13:21 +07:00
|
|
|
endif()
|
|
|
|
|
|
2019-01-30 11:06:06 -06:00
|
|
|
find_package(HDF5 REQUIRED COMPONENTS C HL)
|
2023-12-06 12:35:10 -06:00
|
|
|
|
|
|
|
|
# Remove HDF5 transitive dependencies that are system libraries
|
|
|
|
|
list(FILTER HDF5_LIBRARIES EXCLUDE REGEX ".*lib(pthread|dl|m).*")
|
|
|
|
|
message(STATUS "HDF5 Libraries: ${HDF5_LIBRARIES}")
|
|
|
|
|
|
2015-08-31 11:13:21 +07:00
|
|
|
if(HDF5_IS_PARALLEL)
|
2022-04-05 15:32:43 -05:00
|
|
|
if(NOT OPENMC_USE_MPI)
|
2023-03-16 09:26:23 -05:00
|
|
|
message(FATAL_ERROR "Parallel HDF5 was detected, but MPI was not enabled.\
|
|
|
|
|
To use parallel HDF5, OpenMC needs to be built with MPI support by passing\
|
|
|
|
|
-DOPENMC_USE_MPI=ON when calling cmake.")
|
2015-08-31 11:13:21 +07:00
|
|
|
endif()
|
2019-03-25 21:58:52 -05:00
|
|
|
message(STATUS "Using parallel HDF5")
|
2015-08-31 11:13:21 +07:00
|
|
|
endif()
|
|
|
|
|
|
2020-03-25 16:45:13 +00:00
|
|
|
# Version 1.12 of HDF5 deprecates the H5Oget_info_by_idx() interface.
|
|
|
|
|
# Thus, we give these flags to allow usage of the old interface in newer
|
|
|
|
|
# versions of HDF5.
|
2022-06-21 14:58:39 -05:00
|
|
|
if(${HDF5_VERSION} VERSION_GREATER_EQUAL 1.12.0)
|
2020-03-25 16:45:13 +00:00
|
|
|
list(APPEND cxxflags -DH5Oget_info_by_idx_vers=1 -DH5O_info_t_vers=1)
|
2020-03-25 16:14:28 +00:00
|
|
|
endif()
|
|
|
|
|
|
2022-10-05 10:56:36 +02:00
|
|
|
#===============================================================================
|
|
|
|
|
# MCPL
|
|
|
|
|
#===============================================================================
|
2022-12-22 14:49:47 -06:00
|
|
|
|
2022-10-05 10:56:36 +02:00
|
|
|
if (OPENMC_USE_MCPL)
|
|
|
|
|
find_package(MCPL REQUIRED)
|
2022-12-22 12:27:56 -06:00
|
|
|
message(STATUS "Found MCPL: ${MCPL_DIR} (found version \"${MCPL_VERSION}\")")
|
2022-10-05 10:56:36 +02:00
|
|
|
endif()
|
|
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Set compile/link flags based on which compiler is being used
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2021-02-06 16:24:05 -05:00
|
|
|
# Skip for Visual Studio which has its own configurations through GUI
|
2019-06-06 11:36:39 -04:00
|
|
|
if(NOT MSVC)
|
|
|
|
|
|
2017-06-08 20:17:07 -05:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
|
|
|
|
2022-03-22 10:46:34 -05:00
|
|
|
if(OPENMC_ENABLE_PROFILE)
|
2019-03-25 21:55:22 -05:00
|
|
|
list(APPEND cxxflags -g -fno-omit-frame-pointer)
|
2017-12-01 16:45:28 -05:00
|
|
|
endif()
|
2022-04-05 15:32:43 -05:00
|
|
|
|
2022-03-22 10:46:34 -05:00
|
|
|
if(OPENMC_ENABLE_COVERAGE)
|
2019-05-20 14:26:15 -04:00
|
|
|
list(APPEND cxxflags --coverage)
|
|
|
|
|
list(APPEND ldflags --coverage)
|
|
|
|
|
endif()
|
2017-12-01 16:45:28 -05:00
|
|
|
|
2017-04-10 07:26:48 -05:00
|
|
|
# Show flags being used
|
2019-03-25 21:55:22 -05:00
|
|
|
message(STATUS "OpenMC C++ flags: ${cxxflags}")
|
|
|
|
|
message(STATUS "OpenMC Linker flags: ${ldflags}")
|
2017-04-10 07:26:48 -05:00
|
|
|
|
2019-06-06 11:36:39 -04:00
|
|
|
endif()
|
|
|
|
|
|
2020-01-13 09:57:13 -06:00
|
|
|
#===============================================================================
|
|
|
|
|
# Update git submodules as needed
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
|
|
find_package(Git)
|
|
|
|
|
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
|
|
|
|
option(GIT_SUBMODULE "Check submodules during build" ON)
|
|
|
|
|
if(GIT_SUBMODULE)
|
|
|
|
|
message(STATUS "Submodule update")
|
2021-02-10 12:33:42 -05:00
|
|
|
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
RESULT_VARIABLE GIT_SUBMOD_RESULT)
|
|
|
|
|
if(NOT GIT_SUBMOD_RESULT EQUAL 0)
|
|
|
|
|
message(FATAL_ERROR "git submodule update --init failed with \
|
|
|
|
|
${GIT_SUBMOD_RESULT}, please checkout submodules")
|
2021-02-06 16:24:05 -05:00
|
|
|
endif()
|
2020-01-13 09:57:13 -06:00
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-02-10 12:33:42 -05:00
|
|
|
# Check to see if submodules exist (by checking one)
|
|
|
|
|
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/vendor/pugixml/CMakeLists.txt")
|
|
|
|
|
message(FATAL_ERROR "The git submodules were not downloaded! GIT_SUBMODULE was \
|
|
|
|
|
turned off or failed. Please update submodules and try again.")
|
|
|
|
|
endif()
|
|
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
2017-02-24 15:19:31 -06:00
|
|
|
# pugixml library
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
|
2022-03-17 22:03:10 -05:00
|
|
|
find_package_write_status(pugixml)
|
2021-02-06 16:24:05 -05:00
|
|
|
if (NOT pugixml_FOUND)
|
|
|
|
|
add_subdirectory(vendor/pugixml)
|
2021-02-22 14:37:52 -05:00
|
|
|
set_target_properties(pugixml PROPERTIES CXX_STANDARD 14 CXX_EXTENSIONS OFF)
|
2021-02-06 16:24:05 -05:00
|
|
|
endif()
|
2013-11-29 13:36:06 -05:00
|
|
|
|
2020-01-13 07:02:06 -06:00
|
|
|
#===============================================================================
|
|
|
|
|
# {fmt} library
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2022-03-17 22:03:10 -05:00
|
|
|
find_package_write_status(fmt)
|
2021-02-06 16:24:05 -05:00
|
|
|
if (NOT fmt_FOUND)
|
|
|
|
|
set(FMT_INSTALL ON CACHE BOOL "Generate the install target.")
|
|
|
|
|
add_subdirectory(vendor/fmt)
|
|
|
|
|
endif()
|
2020-01-13 07:02:06 -06:00
|
|
|
|
2018-07-06 10:49:24 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# xtensor header-only library
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2022-03-17 22:03:10 -05:00
|
|
|
find_package_write_status(xtensor)
|
2022-03-17 10:10:49 -05:00
|
|
|
if (NOT xtensor_FOUND)
|
2022-03-15 10:43:22 -05:00
|
|
|
add_subdirectory(vendor/xtl)
|
|
|
|
|
set(xtl_DIR ${CMAKE_CURRENT_BINARY_DIR}/vendor/xtl)
|
|
|
|
|
add_subdirectory(vendor/xtensor)
|
|
|
|
|
endif()
|
2018-07-06 10:49:24 -05:00
|
|
|
|
2019-02-05 11:16:33 -06:00
|
|
|
#===============================================================================
|
|
|
|
|
# GSL header-only library
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2022-03-17 22:03:10 -05:00
|
|
|
find_package_write_status(gsl-lite)
|
2022-03-15 11:01:09 -05:00
|
|
|
if (NOT gsl-lite_FOUND)
|
|
|
|
|
add_subdirectory(vendor/gsl-lite)
|
2019-02-05 11:16:33 -06:00
|
|
|
|
2022-03-15 11:01:09 -05:00
|
|
|
# Make sure contract violations throw exceptions
|
|
|
|
|
target_compile_definitions(gsl-lite-v1 INTERFACE GSL_THROW_ON_CONTRACT_VIOLATION)
|
|
|
|
|
target_compile_definitions(gsl-lite-v1 INTERFACE gsl_CONFIG_ALLOWS_NONSTRICT_SPAN_COMPARISON=1)
|
|
|
|
|
endif()
|
2019-02-05 11:16:33 -06:00
|
|
|
|
2022-11-12 13:32:41 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Catch2 library
|
|
|
|
|
#===============================================================================
|
2023-01-13 10:47:56 -05:00
|
|
|
|
|
|
|
|
if(OPENMC_BUILD_TESTS)
|
|
|
|
|
find_package_write_status(Catch2)
|
2023-04-11 13:32:42 -05:00
|
|
|
if (NOT Catch2_FOUND)
|
2023-01-13 10:47:56 -05:00
|
|
|
add_subdirectory(vendor/Catch2)
|
|
|
|
|
endif()
|
2022-11-12 13:32:41 -05:00
|
|
|
endif()
|
|
|
|
|
|
2015-12-04 21:39:00 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# RPATH information
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2019-11-20 15:45:26 -06:00
|
|
|
# Provide install directory variables as defined by GNU coding standards
|
2019-11-15 16:26:55 -06:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
|
2017-11-22 07:33:11 -06:00
|
|
|
# This block of code ensures that dynamic libraries can be found via the RPATH
|
|
|
|
|
# whether the executable is the original one from the build directory or the
|
|
|
|
|
# installed one in CMAKE_INSTALL_PREFIX. Ref:
|
2018-06-20 16:09:24 -05:00
|
|
|
# https://gitlab.kitware.com/cmake/community/wikis/doc/cmake/RPATH-handling
|
2017-11-22 07:33:11 -06:00
|
|
|
|
|
|
|
|
# use, i.e. don't skip the full RPATH for the build tree
|
|
|
|
|
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
|
|
|
|
|
|
|
|
|
# when building, don't use the install RPATH already
|
|
|
|
|
# (but later on when installing)
|
|
|
|
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
|
|
|
|
|
2015-12-04 21:39:00 -05:00
|
|
|
# add the automatically determined parts of the RPATH
|
|
|
|
|
# which point to directories outside the build tree to the install RPATH
|
|
|
|
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
|
|
|
|
|
2017-11-22 07:33:11 -06:00
|
|
|
# the RPATH to be used when installing, but only if it's not a system directory
|
2019-11-15 16:26:55 -06:00
|
|
|
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_FULL_LIBDIR}" isSystemDir)
|
2017-11-22 07:33:11 -06:00
|
|
|
if("${isSystemDir}" STREQUAL "-1")
|
2019-11-15 16:26:55 -06:00
|
|
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
|
2017-11-22 07:33:11 -06:00
|
|
|
endif()
|
|
|
|
|
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
2018-06-20 12:36:33 -05:00
|
|
|
# libopenmc
|
2013-11-29 13:36:06 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
|
2019-06-06 10:46:01 -04:00
|
|
|
list(APPEND libopenmc_SOURCES
|
2018-11-15 08:13:14 -06:00
|
|
|
src/bank.cpp
|
2020-10-17 20:34:41 -06:00
|
|
|
src/boundary_condition.cpp
|
2019-01-12 17:04:36 -06:00
|
|
|
src/bremsstrahlung.cpp
|
2018-02-03 16:27:33 -05:00
|
|
|
src/cell.cpp
|
2018-11-10 12:11:42 -05:00
|
|
|
src/cmfd_solver.cpp
|
2018-11-05 21:35:41 -06:00
|
|
|
src/cross_sections.cpp
|
2023-04-14 13:00:39 -04:00
|
|
|
src/dagmc.cpp
|
2018-07-02 22:10:38 -05:00
|
|
|
src/distribution.cpp
|
2018-07-09 17:04:48 -05:00
|
|
|
src/distribution_angle.cpp
|
2018-07-09 14:47:08 -05:00
|
|
|
src/distribution_energy.cpp
|
2018-07-05 07:01:19 -05:00
|
|
|
src/distribution_multi.cpp
|
|
|
|
|
src/distribution_spatial.cpp
|
2018-08-30 14:22:55 -05:00
|
|
|
src/eigenvalue.cpp
|
2018-07-09 09:27:34 -05:00
|
|
|
src/endf.cpp
|
2018-10-10 07:50:30 -05:00
|
|
|
src/error.cpp
|
2020-01-19 19:12:32 +00:00
|
|
|
src/event.cpp
|
2023-04-15 11:52:36 -04:00
|
|
|
src/file_utils.cpp
|
2018-04-26 07:03:40 -05:00
|
|
|
src/finalize.cpp
|
2018-08-14 16:22:40 -04:00
|
|
|
src/geometry.cpp
|
2018-05-11 17:20:25 -04:00
|
|
|
src/geometry_aux.cpp
|
2018-04-17 14:08:59 -05:00
|
|
|
src/hdf5_interface.cpp
|
2023-04-14 13:00:39 -04:00
|
|
|
src/initialize.cpp
|
2018-02-04 23:15:32 -05:00
|
|
|
src/lattice.cpp
|
2018-08-15 16:08:32 -04:00
|
|
|
src/material.cpp
|
2018-04-30 15:33:36 -04:00
|
|
|
src/math_functions.cpp
|
2022-12-22 11:33:29 -06:00
|
|
|
src/mcpl_interface.cpp
|
2018-08-28 06:59:39 -05:00
|
|
|
src/mesh.cpp
|
2018-04-20 07:02:59 -05:00
|
|
|
src/message_passing.cpp
|
2018-06-08 16:18:37 -04:00
|
|
|
src/mgxs.cpp
|
2018-06-13 20:22:51 -04:00
|
|
|
src/mgxs_interface.cpp
|
2023-01-09 18:16:45 +07:00
|
|
|
src/ncrystal_interface.cpp
|
2018-07-17 06:43:35 -05:00
|
|
|
src/nuclide.cpp
|
2018-08-14 19:04:05 -04:00
|
|
|
src/output.cpp
|
2018-07-06 06:36:05 -05:00
|
|
|
src/particle.cpp
|
2021-04-16 15:35:33 -04:00
|
|
|
src/particle_data.cpp
|
2019-02-14 12:43:05 -06:00
|
|
|
src/particle_restart.cpp
|
2018-11-15 15:55:05 -06:00
|
|
|
src/photon.cpp
|
2018-11-17 09:24:31 -06:00
|
|
|
src/physics.cpp
|
2018-10-07 07:18:29 -04:00
|
|
|
src/physics_common.cpp
|
2018-10-08 14:01:14 -04:00
|
|
|
src/physics_mg.cpp
|
2018-04-24 22:42:04 -05:00
|
|
|
src/plot.cpp
|
2018-08-08 13:36:42 -05:00
|
|
|
src/position.cpp
|
2018-10-29 18:02:00 -05:00
|
|
|
src/progress_bar.cpp
|
2021-04-26 10:00:21 -05:00
|
|
|
src/random_dist.cpp
|
2017-08-08 18:10:53 -04:00
|
|
|
src/random_lcg.cpp
|
2024-04-18 17:10:16 -05:00
|
|
|
src/random_ray/random_ray_simulation.cpp
|
|
|
|
|
src/random_ray/random_ray.cpp
|
|
|
|
|
src/random_ray/flat_source_domain.cpp
|
2024-07-17 01:53:40 +01:00
|
|
|
src/random_ray/linear_source_domain.cpp
|
|
|
|
|
src/random_ray/moment_matrix.cpp
|
2018-07-11 07:01:54 -05:00
|
|
|
src/reaction.cpp
|
2018-07-10 22:49:37 -05:00
|
|
|
src/reaction_product.cpp
|
2019-02-22 23:26:32 -06:00
|
|
|
src/scattdata.cpp
|
2018-07-10 15:32:18 -05:00
|
|
|
src/secondary_correlated.cpp
|
2018-07-10 07:36:46 -05:00
|
|
|
src/secondary_kalbach.cpp
|
2018-07-09 23:26:05 -05:00
|
|
|
src/secondary_nbody.cpp
|
2019-05-21 14:44:15 -05:00
|
|
|
src/secondary_thermal.cpp
|
2018-07-09 23:02:27 -05:00
|
|
|
src/secondary_uncorrelated.cpp
|
2018-08-06 21:31:30 -05:00
|
|
|
src/settings.cpp
|
2018-04-12 07:45:47 -05:00
|
|
|
src/simulation.cpp
|
2018-07-17 06:43:35 -05:00
|
|
|
src/source.cpp
|
2018-04-20 11:03:40 -05:00
|
|
|
src/state_point.cpp
|
2018-11-06 10:23:11 -06:00
|
|
|
src/string_utils.cpp
|
2018-08-24 19:06:04 -04:00
|
|
|
src/summary.cpp
|
2018-01-23 22:26:48 -05:00
|
|
|
src/surface.cpp
|
2019-01-26 12:10:18 -05:00
|
|
|
src/tallies/derivative.cpp
|
2018-10-22 20:06:54 -04:00
|
|
|
src/tallies/filter.cpp
|
|
|
|
|
src/tallies/filter_azimuthal.cpp
|
|
|
|
|
src/tallies/filter_cell.cpp
|
2019-11-05 08:13:25 -05:00
|
|
|
src/tallies/filter_cell_instance.cpp
|
2023-04-14 13:00:39 -04:00
|
|
|
src/tallies/filter_cellborn.cpp
|
|
|
|
|
src/tallies/filter_cellfrom.cpp
|
|
|
|
|
src/tallies/filter_collision.cpp
|
2018-10-28 15:52:01 -04:00
|
|
|
src/tallies/filter_delayedgroup.cpp
|
2018-10-22 20:06:54 -04:00
|
|
|
src/tallies/filter_distribcell.cpp
|
2018-10-27 15:11:49 -04:00
|
|
|
src/tallies/filter_energy.cpp
|
2023-04-14 13:00:39 -04:00
|
|
|
src/tallies/filter_energyfunc.cpp
|
2018-10-22 20:06:54 -04:00
|
|
|
src/tallies/filter_legendre.cpp
|
|
|
|
|
src/tallies/filter_material.cpp
|
2023-11-09 17:05:42 +01:00
|
|
|
src/tallies/filter_materialfrom.cpp
|
2018-10-22 20:06:54 -04:00
|
|
|
src/tallies/filter_mesh.cpp
|
2024-04-04 16:32:21 -05:00
|
|
|
src/tallies/filter_meshborn.cpp
|
2018-10-22 20:06:54 -04:00
|
|
|
src/tallies/filter_meshsurface.cpp
|
|
|
|
|
src/tallies/filter_mu.cpp
|
2024-10-04 02:07:03 -03:00
|
|
|
src/tallies/filter_musurface.cpp
|
2018-10-28 16:26:22 -04:00
|
|
|
src/tallies/filter_particle.cpp
|
2018-10-22 20:06:54 -04:00
|
|
|
src/tallies/filter_polar.cpp
|
|
|
|
|
src/tallies/filter_sph_harm.cpp
|
|
|
|
|
src/tallies/filter_sptl_legendre.cpp
|
|
|
|
|
src/tallies/filter_surface.cpp
|
2021-09-10 13:57:20 -05:00
|
|
|
src/tallies/filter_time.cpp
|
2018-10-22 20:06:54 -04:00
|
|
|
src/tallies/filter_universe.cpp
|
|
|
|
|
src/tallies/filter_zernike.cpp
|
2018-10-17 19:56:59 -04:00
|
|
|
src/tallies/tally.cpp
|
2019-02-11 14:47:34 -05:00
|
|
|
src/tallies/tally_scoring.cpp
|
2019-01-31 13:39:33 -05:00
|
|
|
src/tallies/trigger.cpp
|
2018-08-14 22:21:41 -05:00
|
|
|
src/thermal.cpp
|
2023-04-14 13:00:39 -04:00
|
|
|
src/timer.cpp
|
2019-02-19 22:06:20 -06:00
|
|
|
src/track_output.cpp
|
2022-02-15 15:36:55 -06:00
|
|
|
src/universe.cpp
|
2019-02-22 23:26:32 -06:00
|
|
|
src/urr.cpp
|
2019-02-06 21:47:08 -06:00
|
|
|
src/volume_calc.cpp
|
2022-01-08 14:43:18 -06:00
|
|
|
src/weight_windows.cpp
|
2018-12-26 07:24:21 -06:00
|
|
|
src/wmp.cpp
|
2018-04-20 07:25:35 -05:00
|
|
|
src/xml_interface.cpp
|
2018-12-26 07:24:21 -06:00
|
|
|
src/xsdata.cpp)
|
2018-02-23 10:40:43 -06:00
|
|
|
|
2021-12-20 09:28:21 -05:00
|
|
|
# Add bundled external dependencies
|
|
|
|
|
list(APPEND libopenmc_SOURCES
|
2022-03-24 15:07:12 -05:00
|
|
|
src/external/quartic_solver.cpp
|
|
|
|
|
src/external/Faddeeva.cc)
|
2021-12-20 09:28:21 -05:00
|
|
|
|
2019-06-06 10:46:01 -04:00
|
|
|
# For Visual Studio compilers
|
|
|
|
|
if(MSVC)
|
|
|
|
|
# Use static library (otherwise explicit symbol portings are needed)
|
|
|
|
|
add_library(libopenmc STATIC ${libopenmc_SOURCES})
|
|
|
|
|
|
|
|
|
|
# To use the shared HDF5 libraries on Windows, the H5_BUILT_AS_DYNAMIC_LIB
|
|
|
|
|
# compile definition must be specified.
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE -DH5_BUILT_AS_DYNAMIC_LIB)
|
|
|
|
|
else()
|
|
|
|
|
add_library(libopenmc SHARED ${libopenmc_SOURCES})
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-03-25 14:28:52 -05:00
|
|
|
add_library(OpenMC::libopenmc ALIAS libopenmc)
|
|
|
|
|
|
2020-07-01 15:20:55 +08:00
|
|
|
# Avoid vs error lnk1149 :output filename matches input filename
|
|
|
|
|
if(NOT MSVC)
|
2021-02-22 14:37:52 -05:00
|
|
|
set_target_properties(libopenmc PROPERTIES OUTPUT_NAME openmc)
|
2020-07-01 15:20:55 +08:00
|
|
|
endif()
|
2015-08-29 16:32:02 +07:00
|
|
|
|
2018-06-20 12:36:33 -05:00
|
|
|
target_include_directories(libopenmc
|
2019-10-30 16:01:31 -05:00
|
|
|
PUBLIC
|
|
|
|
|
$<INSTALL_INTERFACE:include>
|
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
|
|
|
${HDF5_INCLUDE_DIRS}
|
|
|
|
|
)
|
2015-09-14 20:36:51 +07:00
|
|
|
|
2019-02-21 15:49:58 -06:00
|
|
|
# Set compile flags
|
|
|
|
|
target_compile_options(libopenmc PRIVATE ${cxxflags})
|
2017-12-01 16:45:28 -05:00
|
|
|
|
2021-01-18 12:37:18 -06:00
|
|
|
# Add include directory for configured version file
|
2022-05-09 21:22:19 +02:00
|
|
|
target_include_directories(libopenmc
|
|
|
|
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/include>)
|
2021-01-18 12:37:18 -06:00
|
|
|
|
2018-06-20 12:36:33 -05:00
|
|
|
if (HDF5_IS_PARALLEL)
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE -DPHDF5)
|
|
|
|
|
endif()
|
2022-04-05 15:32:43 -05:00
|
|
|
if (OPENMC_USE_MPI)
|
2018-06-20 12:36:33 -05:00
|
|
|
target_compile_definitions(libopenmc PUBLIC -DOPENMC_MPI)
|
|
|
|
|
endif()
|
2015-08-29 16:32:02 +07:00
|
|
|
|
2018-06-20 13:08:05 -05:00
|
|
|
# Set git SHA1 hash as a compile definition
|
2020-01-13 09:57:13 -06:00
|
|
|
if(GIT_FOUND)
|
|
|
|
|
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
|
RESULT_VARIABLE GIT_SHA1_SUCCESS
|
|
|
|
|
OUTPUT_VARIABLE GIT_SHA1
|
|
|
|
|
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
|
|
|
|
|
if(GIT_SHA1_SUCCESS EQUAL 0)
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE -DGIT_SHA1="${GIT_SHA1}")
|
|
|
|
|
endif()
|
2018-06-20 13:08:05 -05:00
|
|
|
endif()
|
2015-08-29 16:32:02 +07:00
|
|
|
|
|
|
|
|
# target_link_libraries treats any arguments starting with - but not -l as
|
|
|
|
|
# linker flags. Thus, we can pass both linker flags and libraries together.
|
2019-01-30 11:06:06 -06:00
|
|
|
target_link_libraries(libopenmc ${ldflags} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES}
|
2024-01-23 16:48:21 +01:00
|
|
|
xtensor gsl::gsl-lite-v1 fmt::fmt ${CMAKE_DL_LIBS})
|
2022-03-17 10:18:15 -05:00
|
|
|
|
|
|
|
|
if(TARGET pugixml::pugixml)
|
|
|
|
|
target_link_libraries(libopenmc pugixml::pugixml)
|
|
|
|
|
else()
|
|
|
|
|
target_link_libraries(libopenmc pugixml)
|
|
|
|
|
endif()
|
2018-06-20 12:22:48 -05:00
|
|
|
|
2022-03-22 10:46:34 -05:00
|
|
|
if(OPENMC_USE_DAGMC)
|
2018-09-25 21:57:12 -05:00
|
|
|
target_compile_definitions(libopenmc PRIVATE DAGMC)
|
2024-04-24 12:05:11 -04:00
|
|
|
target_link_libraries(libopenmc dagmc-shared)
|
2024-10-09 07:57:14 +06:00
|
|
|
|
|
|
|
|
if(OPENMC_USE_UWUW)
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE OPENMC_UWUW)
|
|
|
|
|
target_link_libraries(libopenmc uwuw-shared)
|
|
|
|
|
endif()
|
|
|
|
|
elseif(OPENMC_USE_UWUW)
|
|
|
|
|
set(OPENMC_USE_UWUW OFF)
|
|
|
|
|
message(FATAL_ERROR "DAGMC must be enabled when UWUW is enabled.")
|
2018-09-25 21:57:12 -05:00
|
|
|
endif()
|
2018-06-20 12:22:48 -05:00
|
|
|
|
2022-03-22 10:46:34 -05:00
|
|
|
if(OPENMC_USE_LIBMESH)
|
2020-10-27 22:54:33 -05:00
|
|
|
target_compile_definitions(libopenmc PRIVATE LIBMESH)
|
|
|
|
|
target_link_libraries(libopenmc PkgConfig::LIBMESH)
|
2020-04-10 17:17:45 -05:00
|
|
|
endif()
|
2019-12-05 22:29:47 -06:00
|
|
|
|
2021-09-30 16:28:05 -05:00
|
|
|
if (PNG_FOUND)
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE USE_LIBPNG)
|
|
|
|
|
target_link_libraries(libopenmc PNG::PNG)
|
|
|
|
|
endif()
|
|
|
|
|
|
2024-04-20 00:44:40 -05:00
|
|
|
if (OPENMC_USE_OPENMP)
|
|
|
|
|
target_link_libraries(libopenmc OpenMP::OpenMP_CXX)
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-04-05 15:32:43 -05:00
|
|
|
if (OPENMC_USE_MPI)
|
|
|
|
|
target_link_libraries(libopenmc MPI::MPI_CXX)
|
|
|
|
|
endif()
|
|
|
|
|
|
2023-01-13 10:50:03 -05:00
|
|
|
if (OPENMC_BUILD_TESTS)
|
|
|
|
|
# Add cpp tests directory
|
|
|
|
|
include(CTest)
|
|
|
|
|
add_subdirectory(tests/cpp_unit_tests)
|
|
|
|
|
endif()
|
2022-11-12 13:32:41 -05:00
|
|
|
|
2022-10-05 10:56:36 +02:00
|
|
|
if (OPENMC_USE_MCPL)
|
|
|
|
|
target_compile_definitions(libopenmc PUBLIC OPENMC_MCPL)
|
|
|
|
|
target_link_libraries(libopenmc MCPL::mcpl)
|
|
|
|
|
endif()
|
|
|
|
|
|
2021-09-13 01:25:36 -03:00
|
|
|
if(OPENMC_USE_NCRYSTAL)
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE NCRYSTAL)
|
|
|
|
|
target_link_libraries(libopenmc NCrystal::NCrystal)
|
|
|
|
|
endif()
|
|
|
|
|
|
2022-10-05 17:45:51 -04:00
|
|
|
#===============================================================================
|
|
|
|
|
# Log build info that this executable can report later
|
|
|
|
|
#===============================================================================
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE BUILD_TYPE=${CMAKE_BUILD_TYPE})
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE COMPILER_ID=${CMAKE_CXX_COMPILER_ID})
|
|
|
|
|
target_compile_definitions(libopenmc PRIVATE COMPILER_VERSION=${CMAKE_CXX_COMPILER_VERSION})
|
|
|
|
|
if (OPENMC_ENABLE_PROFILE)
|
2022-10-20 12:12:36 -04:00
|
|
|
target_compile_definitions(libopenmc PRIVATE PROFILINGBUILD)
|
2022-10-05 17:45:51 -04:00
|
|
|
endif()
|
|
|
|
|
if (OPENMC_ENABLE_COVERAGE)
|
2022-10-20 12:12:36 -04:00
|
|
|
target_compile_definitions(libopenmc PRIVATE COVERAGEBUILD)
|
2022-10-05 17:45:51 -04:00
|
|
|
endif()
|
|
|
|
|
|
2018-06-20 12:22:48 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# openmc executable
|
|
|
|
|
#===============================================================================
|
|
|
|
|
add_executable(openmc src/main.cpp)
|
2022-03-25 14:28:52 -05:00
|
|
|
add_executable(OpenMC::openmc ALIAS openmc)
|
2018-06-20 12:36:33 -05:00
|
|
|
target_compile_options(openmc PRIVATE ${cxxflags})
|
2021-01-18 12:37:18 -06:00
|
|
|
target_include_directories(openmc PRIVATE ${CMAKE_BINARY_DIR}/include)
|
2018-06-20 12:22:48 -05:00
|
|
|
target_link_libraries(openmc libopenmc)
|
2013-12-05 23:32:08 -05:00
|
|
|
|
2024-06-17 16:00:45 -05:00
|
|
|
# Ensure C++17 standard is used and turn off GNU extensions
|
|
|
|
|
target_compile_features(openmc PUBLIC cxx_std_17)
|
|
|
|
|
target_compile_features(libopenmc PUBLIC cxx_std_17)
|
2022-05-23 12:33:12 -05:00
|
|
|
set_target_properties(openmc libopenmc PROPERTIES CXX_EXTENSIONS OFF)
|
2019-02-22 23:26:32 -06:00
|
|
|
|
2017-06-09 11:58:14 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Python package
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
|
|
|
|
add_custom_command(TARGET libopenmc POST_BUILD
|
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
|
|
|
$<TARGET_FILE:libopenmc>
|
2019-09-05 07:31:13 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/openmc/lib/$<TARGET_FILE_NAME:libopenmc>
|
2017-06-09 11:58:14 -05:00
|
|
|
COMMENT "Copying libopenmc to Python module directory")
|
|
|
|
|
|
2013-12-05 23:32:08 -05:00
|
|
|
#===============================================================================
|
|
|
|
|
# Install executable, scripts, manpage, license
|
|
|
|
|
#===============================================================================
|
|
|
|
|
|
2020-02-20 13:09:15 -06:00
|
|
|
configure_file(cmake/OpenMCConfig.cmake.in "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenMCConfig.cmake" @ONLY)
|
2021-01-18 12:37:18 -06:00
|
|
|
configure_file(cmake/OpenMCConfigVersion.cmake.in "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenMCConfigVersion.cmake" @ONLY)
|
2020-02-20 13:09:15 -06:00
|
|
|
|
2019-10-30 16:01:31 -05:00
|
|
|
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/OpenMC)
|
2022-03-24 15:07:12 -05:00
|
|
|
install(TARGETS openmc libopenmc
|
2019-10-30 16:01:31 -05:00
|
|
|
EXPORT openmc-targets
|
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
|
)
|
|
|
|
|
install(EXPORT openmc-targets
|
|
|
|
|
FILE OpenMCTargets.cmake
|
|
|
|
|
NAMESPACE OpenMC::
|
|
|
|
|
DESTINATION ${INSTALL_CONFIGDIR})
|
|
|
|
|
|
2021-01-18 12:37:18 -06:00
|
|
|
install(FILES
|
|
|
|
|
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenMCConfig.cmake"
|
|
|
|
|
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenMCConfigVersion.cmake"
|
|
|
|
|
DESTINATION ${INSTALL_CONFIGDIR})
|
2019-10-30 16:01:31 -05:00
|
|
|
install(FILES man/man1/openmc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
|
|
|
|
install(FILES LICENSE DESTINATION "${CMAKE_INSTALL_DOCDIR}" RENAME copyright)
|
|
|
|
|
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
2022-05-09 21:20:08 +02:00
|
|
|
install(FILES "${CMAKE_BINARY_DIR}/include/openmc/version.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openmc)
|