diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 2c36a2ecf..34c55e6a9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,22 @@ +Version vYYYY.MM.p -- Release date YYYY-MM-DD +============================================== + * Important Notes: + * The PolyClipper and PYB11Generator submodules have been modified. Be sure to recursively update the submodules. + +Notable changes include: + + * New features/ API changes: + + + * Build changes / improvements: + * Spheral now provides First Class CMake support (using the BLT nomenclature). Spheral and its dependencies are now exported to simplify importing the project. To import Spheral into another project using CMake, use + ``` + find_package(Spheral_CXX ) + ``` + * CMake variables have a more consistent naming convention. Unused variables are removed. + + * Bug Fixes / improvements: + Version v2023-06-0 -- Release date 2023-06-20 ============================================== diff --git a/cmake/InstallTPLs.cmake b/cmake/InstallTPLs.cmake index 76182950c..772b673e4 100644 --- a/cmake/InstallTPLs.cmake +++ b/cmake/InstallTPLs.cmake @@ -5,88 +5,91 @@ # Do NOT add any TPLs to the clean target set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1) +# Set the location of the .cmake files +set(TPL_SPHERAL_CMAKE_DIR ${SPHERAL_ROOT_DIR}/cmake/tpl) + #----------------------------------------------------------------------------------- # Submodules #----------------------------------------------------------------------------------- -# Things all Spheral packages have in their include path -set(SPHERAL_EXTERN_INCLUDES ) - -# PolyClipper -if (NOT polyclipper_DIR) - set(polyclipper_DIR "${SPHERAL_ROOT_DIR}/extern/PolyClipper" CACHE PATH "") -endif() -set(polyclipper_INCLUDES "${polyclipper_DIR}/src") - -list(APPEND SPHERAL_EXTERN_INCLUDES ${polyclipper_INCLUDES}) - - if (NOT ENABLE_CXXONLY) # Find the appropriate Python set(Python3_ROOT_DIR ${python_DIR}) find_package(Python3 COMPONENTS Interpreter Development) + set(PYTHON_EXE ${Python3_EXECUTABLE}) + list(APPEND SPHERAL_BLT_DEPENDS Python3::Python) # Set the PYB11Generator path if (NOT PYB11GENERATOR_ROOT_DIR) set(PYB11GENERATOR_ROOT_DIR "${SPHERAL_ROOT_DIR}/extern/PYB11Generator" CACHE PATH "") endif() - include(${PYB11GENERATOR_ROOT_DIR}/cmake/PYB11Generator.cmake) - # Set the pybind11 path if (NOT PYBIND11_ROOT_DIR) set(PYBIND11_ROOT_DIR "${PYB11GENERATOR_ROOT_DIR}/extern/pybind11" CACHE PATH "") endif() + include(${PYB11GENERATOR_ROOT_DIR}/cmake/PYB11Generator.cmake) + list(APPEND SPHERAL_BLT_DEPENDS pybind11_headers) + install(TARGETS pybind11_headers + EXPORT spheral_cxx-targets + DESTINATION lib/cmake) + set_target_properties(pybind11_headers PROPERTIES EXPORT_NAME spheral::pybind11_headers) +endif() - list(APPEND SPHERAL_EXTERN_INCLUDES ${PYBIND11_ROOT_DIR}/include) +# This is currently unfilled in spheral +set_property(GLOBAL PROPERTY SPHERAL_SUBMOD_INCLUDES "${SPHERAL_SUBMOD_INCLUDES}") + +# PolyClipper +if (NOT polyclipper_DIR) + set(polyclipper_DIR "${SPHERAL_ROOT_DIR}/extern/PolyClipper" CACHE PATH "") endif() +# Must set this so PolyClipper doesn't include unnecessary python scripts +set(POLYCLIPPER_MODULE_GEN OFF) +set(POLYCLIPPER_ENABLE_DOCS OFF) +set(POLYCLIPPER_INSTALL_DIR "PolyClipper/include") +add_subdirectory(${polyclipper_DIR}) +# Treat includes as system to prevent warnings +blt_patch_target(NAME PolyClipperAPI TREAT_INCLUDES_AS_SYSTEM ON) +list(APPEND SPHERAL_BLT_DEPENDS PolyClipperAPI) +install(TARGETS PolyClipperAPI + EXPORT spheral_cxx-targets + DESTINATION lib/cmake) +set_target_properties(PolyClipperAPI PROPERTIES EXPORT_NAME spheral::PolyClipperAPI) #----------------------------------------------------------------------------------- # Find pre-compiled TPLs #----------------------------------------------------------------------------------- +# Use find_package to get axom (which brings in fmt) and patch fmt +list(APPEND SPHERAL_BLT_DEPENDS axom) +find_package(axom REQUIRED QUIET NO_DEFAULT_PATH PATHS ${axom_DIR}/lib/cmake) +# Add fmt library to external library list +list(APPEND SPHERAL_BLT_DEPENDS fmt) +blt_patch_target(NAME fmt TREAT_INCLUDES_AS_SYSTEM ON) + # Initialize TPL options include(${SPHERAL_ROOT_DIR}/cmake/spheral/SpheralHandleTPL.cmake) -# These libs are always needed -Spheral_Handle_TPL(zlib spheral_depends cxx) -Spheral_Handle_TPL(boost spheral_depends cxx) -Spheral_Handle_TPL(eigen spheral_depends cxx) -Spheral_Handle_TPL(qhull spheral_depends cxx) -Spheral_Handle_TPL(silo spheral_depends cxx) +# TPLs that must be imported +list(APPEND SPHERAL_EXTERN_LIBS zlib boost eigen qhull silo hdf5 polytope) -# AXOM PUlls in HDF5 and Conduit for us -#Spheral_Handle_TPL(conduit spheral_depends cxx) -find_package(axom REQUIRED QUIET NO_DEFAULT_PATH PATHS ${axom_DIR}/lib/cmake) -if(axom_FOUND) - list(APPEND spheral_blt_cxx_depends axom fmt) - blt_patch_target(NAME fmt TREAT_INCLUDES_AS_SYSTEM On) - message(STATUS "Found axom: ${axom_DIR} (found version ${axom_VERSION})") -endif() - -# Axom imports hdf5 lib but Spheral also requires hdf5_hl -Spheral_Handle_TPL(hdf5 spheral_depends cxx) - -# Some libraries are optional -if (ENABLE_ANEOS) - Spheral_Handle_TPL(aneos spheral_depends cxx) +if(ENABLE_ANEOS) + list(APPEND SPHERAL_EXTERN_LIBS aneos) endif() -if (ENABLE_OPENSUBDIV) - Spheral_Handle_TPL(opensubdiv spheral_depends cxx) +if(ENABLE_OPENSUBDIV) + list(APPEND SPHERAL_EXTERN_LIBS opensubdiv) endif() if(ENABLE_TIMER) - Spheral_Handle_TPL(caliper spheral_depends cxx) -endif() - -# Only needed when building the python interface of spheral -if(NOT ENABLE_CXXONLY) - Spheral_Handle_TPL(python spheral_depends cxx) - #Spheral_Handle_TPL(pyb11generator spheral_depends py) - #Spheral_Handle_TPL(pybind11 spheral_depends py) + list(APPEND SPHERAL_EXTERN_LIBS caliper) endif() -Spheral_Handle_TPL(polytope spheral_depends cxx) -#Spheral_Handle_TPL(polyclipper spheral_depends cxx) +# Create and install target library for each external library +foreach(lib ${SPHERAL_EXTERN_LIBS}) + Spheral_Handle_TPL(${lib} ${TPL_SPHERAL_CMAKE_DIR}) + list(APPEND SPHERAL_BLT_DEPENDS ${lib}) +endforeach() +# Note: SPHERAL_BLT_DEPENDS is made global after this in SetupSpheral.cmake +# This calls LLNLSpheralInstallTPLs.cmake if (EXISTS ${EXTERNAL_SPHERAL_TPL_CMAKE}) include(${EXTERNAL_SPHERAL_TPL_CMAKE}) endif() diff --git a/cmake/SetupSpheral.cmake b/cmake/SetupSpheral.cmake index 690c050ea..8e28f95f9 100644 --- a/cmake/SetupSpheral.cmake +++ b/cmake/SetupSpheral.cmake @@ -59,11 +59,11 @@ endif() if(ENABLE_MPI) set(BLT_MPI_COMPILE_FLAGS -DUSE_MPI -DMPICH_SKIP_MPICXX -ULAM_WANT_MPI2CPP -DOMPI_SKIP_MPICXX) - list(APPEND spheral_blt_depends mpi) + list(APPEND SPHERAL_BLT_DEPENDS mpi) endif() if(ENABLE_OPENMP) - list(APPEND spheral_blt_depends openmp) + list(APPEND SPHERAL_BLT_DEPENDS openmp) endif() if(ENABLE_CUDA) @@ -117,15 +117,12 @@ set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) #------------------------------------------------------------------------------- -# We need the set of Spheral C++ libraries globally +# Set global variables used for dependencies #------------------------------------------------------------------------------- -set_property(GLOBAL PROPERTY SPHERAL_CXX_LIBS) - -#------------------------------------------------------------------------------- -# Also globally set the variable for the list we accumulate the obj files from -# each library into -#------------------------------------------------------------------------------- -set_property(GLOBAL PROPERTY SPHERAL_OBJ_LIBS) +# List of external dependencies +set_property(GLOBAL PROPERTY SPHERAL_BLT_DEPENDS "${SPHERAL_BLT_DEPENDS}") +# List of compiler dependencies +set_property(GLOBAL PROPERTY SPHERAL_CXX_DEPENDS "${SPHERAL_CXX_DEPENDS}") #------------------------------------------------------------------------------- # Prepare to build the src @@ -178,3 +175,5 @@ if (ENABLE_TESTS) SOURCE ${SPHERAL_ROOT_DIR} DESTINATION ${SPHERAL_TEST_INSTALL_PREFIX}) endif() + +include(${SPHERAL_ROOT_DIR}/cmake/SpheralConfig.cmake) diff --git a/cmake/SpheralConfig.cmake b/cmake/SpheralConfig.cmake new file mode 100644 index 000000000..4f51f2d8a --- /dev/null +++ b/cmake/SpheralConfig.cmake @@ -0,0 +1,28 @@ + +message(STATUS "Configuring Spheral version ${SPHERAL_VERSION}") + +set(SPHERAL_INSTALL_INCLUDE_DIR "include" CACHE STRING "") +set(SPHERAL_INSTALL_CONFIG_DIR "lib" CACHE STRING "") +set(SPHERAL_INSTALL_LIB_DIR "lib" CACHE STRING "") +set(SPHERAL_INSTALL_BIN_DIR "bin" CACHE STRING "") +set(SPHERAL_INSTALL_CMAKE_MODULE_DIR "${SPHERAL_INSTALL_CONFIG_DIR}/cmake" CACHE STRING "") +set(SPHERAL_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE STRING "" FORCE) +set(SPHERAL_INSTALL_SPHERAL "Spheral" CACHE STRING "") + +include(CMakePackageConfigHelpers) + +configure_package_config_file( + ${SPHERAL_ROOT_DIR}/cmake/spheral_cxx-config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/spheral_cxx-config.cmake + INSTALL_DESTINATION ${SPHERAL_INSTALL_CONFIG_DIR} + PATH_VARS + SPHERAL_INSTALL_INCLUDE_DIR + SPHERAL_INSTALL_LIB_DIR + SPHERAL_INSTALL_BIN_DIR + SPHERAL_INSTALL_CMAKE_MODULE_DIR + SPHERAL_INSTALL_SPHERAL +) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/spheral_cxx-config.cmake + DESTINATION ${SPHERAL_INSTALL_CMAKE_MODULE_DIR} +) + diff --git a/cmake/spheral/SpheralAddLibs.cmake b/cmake/spheral/SpheralAddLibs.cmake index 935067cd9..e1c896138 100644 --- a/cmake/spheral/SpheralAddLibs.cmake +++ b/cmake/spheral/SpheralAddLibs.cmake @@ -1,121 +1,114 @@ -#----------------------------------------------------------------------------------- -# spheral_add_obj_library -# - Generates the blt libraries for a given spheral C++ package -# -# package_name : *name* of spheral package to make into a library -# obj_libs_list : *name* of a CMake list which we will add the library object files to -# -# Variables that must be set before calling spheral_add_obj_library: -# ENABLE_STATIC_CXXONLY : Default False -# - If set to true all libs will be made static -# _headers -# - List of headers to be installed -# _sources -# - List of sources to build library with -# spheral_depends -# - List of targets the library depends on -# spheral_blt_depends -# - List of blt/libs the library depends on -# -#----------------------------------------------------------------------------------- -function(spheral_add_obj_library - package_name) - - set(obj_libs_list SPHERAL_OBJ_LIBS) - - # We can optionally specify the obj_libs_list - set(extra_args ${ARGN}) - list(LENGTH extra_args extra_count) - if (${extra_count} GREATER 0) - list(GET extra_args 0 obj_libs_list) - endif() - - blt_add_library(NAME Spheral_${package_name} - HEADERS ${${package_name}_headers} - SOURCES ${${package_name}_sources} - DEPENDS_ON ${spheral_blt_depends} ${spheral_blt_cxx_depends} ${${package_name}_ADDITIONAL_DEPENDS} ${SPHERAL_CXX_DEPENDS} - OBJECT TRUE - ) - target_include_directories(Spheral_${package_name} PRIVATE ${SPHERAL_INCLUDES}) - target_include_directories(Spheral_${package_name} SYSTEM PRIVATE ${SPHERAL_EXTERN_INCLUDES}) - +#---------------------------------------------------------------------------------------- +# spheral_add_obj_library +#---------------------------------------------------------------------------------------- +# ------------------------------------------- +# VARIABLES THAT NEED TO BE PREVIOUSLY DEFINED +# ------------------------------------------- +# SPHERAL_BLT_DEPENDS : REQUIRED : List of external dependencies +# SPHERAL_CXX_DEPENDS : REQUIRED : List of compiler dependencies +# _headers : OPTIONAL : List of necessary headers to include +# _sources : OPTIONAL : List of necessary source files to include +# SPHERAL_SUBMOD_DEPENDS : REQUIRED : List of submodule dependencies +# ---------------------- +# INPUT-OUTPUT VARIABLES +# ---------------------- +# package_name : REQUIRED : Desired package name +# obj_list_name : REQUIRED : The NAME of the global variable that is the list of +# internal target libraries (not the list itself) +# ----------------------- +# OUTPUT VARIABLES TO USE - Made available implicitly after function call +# ----------------------- +# Spheral_ : Target for a given spheral package +# : List of internal Spheral target objects, appended with target name +#---------------------------------------------------------------------------------------- +function(spheral_add_obj_library package_name obj_list_name) + # Assumes global variable SPHERAL_BLT_DEPENDS exists and is filled with external dependencies + get_property(SPHERAL_BLT_DEPENDS GLOBAL PROPERTY SPHERAL_BLT_DEPENDS) + # Assumes global variable SPHERAL_CXX_DEPENDS exists and is filled with compiler dependencies + get_property(SPHERAL_CXX_DEPENDS GLOBAL PROPERTY SPHERAL_CXX_DEPENDS) + # For including files in submodules, currently unused + get_property(SPHERAL_SUBMOD_INCLUDES GLOBAL PROPERTY SPHERAL_SUBMOD_INCLUDES) + + blt_add_library(NAME Spheral_${package_name} + HEADERS ${${package_name}_headers} + SOURCES ${${package_name}_sources} + DEPENDS_ON ${SPHERAL_BLT_DEPENDS} ${SPHERAL_CXX_DEPENDS} + OBJECT TRUE) + target_include_directories(Spheral_${package_name} SYSTEM PUBLIC ${SPHERAL_SUBMOD_INCLUDES}) # Install the headers - install(FILES ${${package_name}_headers} - DESTINATION include/${package_name} - ) + install(FILES ${${package_name}_headers} + DESTINATION include/${package_name}) + # Append Spheral_${package_name} to the global object list + # For example, SPHERAL_OBJ_LIBS or LLNLSPHERAL_OBJ_LIBS + set_property(GLOBAL APPEND PROPERTY ${obj_list_name} Spheral_${package_name}) if(ENABLE_CUDA) set_target_properties(Spheral_${package_name} PROPERTIES CUDA_SEPARABLE_COMPILATION ON) endif() - # Add this to the obj_libs_list list - get_property(${obj_libs_list} GLOBAL PROPERTY ${obj_libs_list}) - list(APPEND ${obj_libs_list} Spheral_${package_name}) - set_property(GLOBAL PROPERTY ${obj_libs_list} "${${obj_libs_list}}") - endfunction() -#----------------------------------------------------------------------------------- -# spheral_add_cxx_library -# - same interface as spheral_add_obj_library -#----------------------------------------------------------------------------------- -function(spheral_add_cxx_library - package_name) - - set(obj_libs_list SPHERAL_OBJ_LIBS) - set(EXTRA_CXX_DEPENDS ) - - # We can optionally specify the obj_libs_list and any additional dependencies - set(extra_args ${ARGN}) - list(LENGTH extra_args extra_count) - if (${extra_count} GREATER 0) - list(GET extra_args 0 obj_libs_list) - endif() - if (${extra_count} GREATER 1) - list(GET extra_args 1 optional_arg) - list(APPEND EXTRA_CXX_DEPENDS ${optional_arg}) - endif() - get_property(${obj_libs_list} GLOBAL PROPERTY ${obj_libs_list}) +#---------------------------------------------------------------------------------------- +# spheral_add_cxx_library +#---------------------------------------------------------------------------------------- +# ------------------------------------------- +# VARIABLES THAT NEED TO BE PREVIOUSLY DEFINED +# ------------------------------------------- +# SPHERAL_BLT_DEPENDS : REQUIRED : List of external dependencies +# SPHERAL_CXX_DEPENDS : REQUIRED : List of compiler dependencies +# _headers : OPTIONAL : List of necessary headers to include +# _sources : OPTIONAL : List of necessary source files to include +# SPHERAL_SUBMOD_DEPENDS : REQUIRED : List of submodule dependencies +# ---------------------- +# INPUT-OUTPUT VARIABLES +# ---------------------- +# package_name : REQUIRED : Desired package name +# _cxx_obj_list : REQUIRED : List of internal targets to include +# ----------------------- +# OUTPUT VARIABLES TO USE - Made available implicitly after function call +# ----------------------- +# Spheral_ : Exportable target for interal package name library +#---------------------------------------------------------------------------------------- +function(spheral_add_cxx_library package_name _cxx_obj_list) + # Assumes global variable SPHERAL_BLT_DEPENDS exists and is filled with external dependencies + get_property(SPHERAL_BLT_DEPENDS GLOBAL PROPERTY SPHERAL_BLT_DEPENDS) + # Assumes global variable spheral_cxx_depends exists and is filled with compiler dependencies + get_property(SPHERAL_CXX_DEPENDS GLOBAL PROPERTY SPHERAL_CXX_DEPENDS) + # For including files in submodules, currently unused + get_property(SPHERAL_SUBMOD_INCLUDES GLOBAL PROPERTY SPHERAL_SUBMOD_INCLUDES) if(NOT ENABLE_SHARED) # Build static spheral C++ library - blt_add_library(NAME Spheral_${package_name} - HEADERS ${${package_name}_headers} - SOURCES ${${package_name}_sources} - DEPENDS_ON ${${obj_libs_list}} ${SPHERAL_CXX_DEPENDS} ${EXTRA_CXX_DEPENDS} - SHARED FALSE - ) + blt_add_library(NAME Spheral_${package_name} + HEADERS ${${package_name}_headers} + SOURCES ${${package_name}_sources} + DEPENDS_ON ${_cxx_obj_list} ${SPHERAL_BLT_DEPENDS} ${SPHERAL_CXX_DEPENDS} + SHARED FALSE) else() # Build shared spheral C++ library - blt_add_library(NAME Spheral_${package_name} - HEADERS ${${package_name}_headers} - SOURCES ${${package_name}_sources} - DEPENDS_ON ${${obj_libs_list}} ${SPHERAL_CXX_DEPENDS} ${EXTRA_CXX_DEPENDS} - SHARED TRUE - ) + blt_add_library(NAME Spheral_${package_name} + HEADERS ${${package_name}_headers} + SOURCES ${${package_name}_sources} + DEPENDS_ON ${_cxx_obj_list} ${SPHERAL_BLT_DEPENDS} ${SPHERAL_CXX_DEPENDS} + SHARED TRUE) endif() - - get_target_property(_INTERFACE_INCLUDE_DIRECTORIES Spheral_${package_name} INTERFACE_INCLUDE_DIRECTORIES) - set_target_properties(Spheral_${package_name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "$") - - get_target_property(_LINK_LIBRARIES Spheral_${package_name} LINK_LIBRARIES) - LIST(REMOVE_DUPLICATES _LINK_LIBRARIES) - set_target_properties(Spheral_${package_name} PROPERTIES LINK_LIBRARIES "${_LINK_LIBRARIES};${_LINK_LIBRARIES}") - + target_include_directories(Spheral_${package_name} SYSTEM PRIVATE ${SPHERAL_SUBMOD_INCLUDES}) if(ENABLE_CUDA) set_target_properties(Spheral_${package_name} PROPERTIES CUDA_SEPARABLE_COMPILATION ON) endif() + # Convert package name to lower-case for export target name + string(TOLOWER ${package_name} lower_case_package) + # Install Spheral C++ target and set it as an exportable CMake target - install(TARGETS Spheral_${package_name} - DESTINATION lib - EXPORT ${PROJECT_NAME}-targets - ) + install(TARGETS Spheral_${package_name} + DESTINATION lib + EXPORT spheral_${lower_case_package}-targets) + # Export Spheral target + install(EXPORT spheral_${lower_case_package}-targets DESTINATION lib/cmake) # Set the r-path of the C++ lib such that it is independent of the build dir when installed - set_target_properties(Spheral_${package_name} PROPERTIES - INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${conduit_DIR}/lib;${axom_DIR}/lib;${boost_DIR}/lib;${hdf5_DIR}/lib;${zlib_DIR}/lib;${SPHERAL_ADDITIONAL_RPATHS}" - ) + set_target_properties(Spheral_${package_name} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") endfunction() @@ -132,7 +125,7 @@ endfunction() # Variables that must be set before calling spheral_add_obj_library: # spheral_depends # - List of targets the library depends on -# spheral_blt_depends +# SPHERAL_BLT_DEPENDS # - List of blt/libs the library depends on # #----------------------------------------------------------------------------------- @@ -199,6 +192,7 @@ function(spheral_add_pybind11_library package_name) string(JOIN ":" PYTHON_ENV_STR ${PYTHON_ENV_STR} ${SPACK_PYTHONPATH}) # Get the TPL dependencies + get_property(SPHERAL_BLT_DEPENDS GLOBAL PROPERTY SPHERAL_BLT_DEPENDS) get_property(spheral_tpl_includes GLOBAL PROPERTY spheral_tpl_includes) get_property(spheral_tpl_libraries GLOBAL PROPERTY spheral_tpl_libraries) @@ -206,7 +200,7 @@ function(spheral_add_pybind11_library package_name) PYB11Generator_add_module(${package_name} MODULE ${MODULE_NAME} SOURCE ${package_name}_PYB11.py - DEPENDS ${spheral_depends} ${spheral_blt_depends} ${${package_name}_DEPENDS} ${SPHERAL_CXX_DEPENDS} ${EXTRA_CXX_DEPENDS} Spheral_CXX + DEPENDS ${spheral_depends} ${SPHERAL_BLT_DEPENDS} ${${package_name}_DEPENDS} ${SPHERAL_CXX_DEPENDS} ${EXTRA_CXX_DEPENDS} Spheral_CXX PYTHONPATH ${PYTHON_ENV_STR} INCLUDES ${CMAKE_CURRENT_SOURCE_DIR} ${SPHERAL_INCLUDES} ${${package_name}_INCLUDES} ${spheral_tpl_includes} ${PYBIND11_ROOT_DIR}/include LINKS ${spheral_tpl_libraries} @@ -215,16 +209,14 @@ function(spheral_add_pybind11_library package_name) EXTRA_SOURCE ${${package_name}_SOURCES} INSTALL OFF ) - target_include_directories(${package_name} SYSTEM PRIVATE ${SPHERAL_EXTERN_INCLUDES}) - target_compile_options(${package_name} PRIVATE ${SPHERAL_PYB11_TARGET_FLAGS}) + target_include_directories(${MODULE_NAME} SYSTEM PRIVATE ${SPHERAL_EXTERN_INCLUDES}) + target_compile_options(${MODULE_NAME} PRIVATE ${SPHERAL_PYB11_TARGET_FLAGS}) - install(TARGETS ${package_name} + install(TARGETS ${MODULE_NAME} DESTINATION Spheral ) # Set the r-path of the C++ lib such that it is independent of the build dir when installed - set_target_properties(${package_name} PROPERTIES - INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${conduit_DIR}/lib;${axom_DIR}/lib;${boost_DIR}/lib;${python_DIR}/lib;${hdf5_DIR}/lib;${zlib_DIR}/lib;${SPHERAL_ADDITIONAL_RPATHS}" - ) + set_target_properties(${MODULE_NAME} PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") endfunction() diff --git a/cmake/spheral/SpheralHandleTPL.cmake b/cmake/spheral/SpheralHandleTPL.cmake index c5bc5be06..3e75a8978 100644 --- a/cmake/spheral/SpheralHandleTPL.cmake +++ b/cmake/spheral/SpheralHandleTPL.cmake @@ -1,125 +1,96 @@ -# Initialize commonly used paths during TPL installs -set(CACHE_DIR ${CMAKE_BINARY_DIR}/tpl/cache) -set(PATCH_DIR ${SPHERAL_ROOT_DIR}/src/tpl/patch) -set(TPL_CMAKE_DIR ${SPHERAL_ROOT_DIR}/cmake/tpl) - -# Verboseness of TPL builds -if (TPL_VERBOSE) - set(OUT_PROTOCOL_EP 0) -else() - set(OUT_PROTOCOL_EP 1) - set(OUT_PROTOCOL_PIP "-q") -endif() - -# Set the build directory for TPL to default to BUILD/Spheral-tpl if SPHERAL_TPL_DIR -# is not set. -if (NOT SPHERAL_TPL_DIR) - get_filename_component(DEFAULT_TPL_LOCATION ${CMAKE_BINARY_DIR}/Spheral/tpl ABSOLUTE) -else() - if (NOT IS_ABSOLUTE ${SPHERAL_TPL_DIR}) - set(SPHERAL_TPL_DIR ${CMAKE_BINARY_DIR}/${SPHERAL_TPL_DIR}) - endif() - get_filename_component(DEFAULT_TPL_LOCATION ${SPHERAL_TPL_DIR} ABSOLUTE) -endif() -message("Default TPL location : ${DEFAULT_TPL_LOCATION}\n") #---------------------------------------------------------------------------------------- # Spheral_Handle_TPL #---------------------------------------------------------------------------------------- # ------------------------------------------- -# VARIBALES THAT NEED TO BE PREVIOSLY DEFINED +# VARIABLES THAT NEED TO BE PREVIOUSLY DEFINED # ------------------------------------------- -# BUILD_TPL : REQUIRED : Set at configure time defines weather to search or build tpl. -# _DIR : OPTIONAL : The installation location of the tpl, if installed or not. -# If not set and BUILD_TPL=On will be installed to a -# default loc. +# _DIR : REQUIRED : The installation location of the TPL +# _INCLUDES : OPTIONAL : Specific includes for the TPL # ---------------------- -# INPUT-OUTPUT VARIBALES +# INPUT-OUTPUT VARIABLES # ---------------------- -# : REQUIRED : The name of the target tpl -# : REQUIRED : list that appends new target to itself. +# : REQUIRED : The name of the target TPL +# TPL_CMAKE_DIR : REQUIRED : Directory containing files for each TPL +# listing their library names # ----------------------- -# OUTPUT VARIABLES TO USE - Made available implicitly after funciton call. +# OUTPUT VARIABLES TO USE - Made available implicitly after function call # ----------------------- -# _libs : list of full paths to tpl lib files to be linked to. +# : Exportable target for the TPL #---------------------------------------------------------------------------------------- -function(Spheral_Handle_TPL lib_name dep_list target_type) +function(Spheral_Handle_TPL lib_name TPL_CMAKE_DIR) - # If no location to search is sepcified, search default dir + # Make shortcut variable for directory assigned to ${lib_name}_DIR + set(lib_dir "${${lib_name}_DIR}") if (NOT ${lib_name}_DIR) - message("${lib_name}_DIR not set.") + message(FATAL_ERROR "${lib_name}_DIR not set.") else() message("${lib_name}_DIR set.") message("Searching ${lib_name} for : ${${lib_name}_DIR}") endif() - # Default this flag for the TPL to be added as a BLT lib, - # in the .cmake file we may change this so as not to - # add a blt lib component - set(${lib_name}_ADD_BLT_TARGET ON) - - # Include the actual .cmake file + # Find libraries + set(${lib_name}_libs "") + # Library names to be set in .cmake file include(${TPL_CMAKE_DIR}/${lib_name}.cmake) - - if (NOT DEFINED ${lib_name}_NO_INCLUDES) - list(APPEND ${lib_name}_INCLUDES $) - endif() - - # Generate full path to lib file for output list + # If library names are given, find them set(${lib_name}_LIBRARIES ) foreach(libpath ${${lib_name}_libs}) - if(IS_ABSOLUTE ${libpath}) - get_filename_component(lib ${libpath} NAME) - set(temp_abs_path ${libpath}) + find_library(${libpath}_clib NAMES ${libpath} + PATHS ${lib_dir}/lib + REQUIRED + NO_CACHE + NO_DEFAULT_PATH + NO_CMAKE_ENVIRONMENT_PATH + NO_CMAKE_PATH + NO_SYSTEM_ENVIRONMENT_PATH + NO_CMAKE_SYSTEM_PATH) + list(APPEND ${lib_name}_LIBRARIES ${${libpath}_clib}) + message("Importing libraries for ${${libpath}_clib}") + # find_library treats output as a standard variable from 3.21+ + # We get different behavior on earlier CMake versions. + if(${CMAKE_VERSION} VERSION_LESS "3.21.0") + unset(${libpath}_clib CACHE) else() - set(lib ${libpath}) - find_file(temp_abs_path - NAME ${lib} - PATHS ${${lib_name}_DIR} - PATH_SUFFIXES lib lib64 - NO_CACHE - NO_DEFAULT_PATH - ) + unset(${libpath}_clib) endif() - # set(temp_abs_path "${${lib_name}_DIR}/lib/${lib}") - list(APPEND ${lib_name}_LIBRARIES $) - - # Check all necessary files exist during config time when not installing TPL - if (NOT EXISTS ${temp_abs_path}) - message(FATAL_ERROR "Cannot find ${lib} in ${${lib_name}_DIR} for TPL ${lib_name}. Full path: ${tmp_abs_path}") - else() - message("Found: ${temp_abs_path}") + endforeach() + # Find includes by assuming they are explicitly provided as ${lib_name}_INCLUDES + set(${lib_name}_INCLUDE_DIR ${${lib_name}_INCLUDES}) + + # If include directories are not explicity set, look for an include directory + string(COMPARE EQUAL "${${lib_name}_INCLUDE_DIR}" "" incl_test) + if(incl_test) # Includes are not explicitly provided + # Look for an include directory but it isn't required + if(EXISTS "${lib_dir}/include/") + set(${lib_name}_INCLUDE_DIR "${lib_dir}/include") + message("Importing includes for ${lib_name}") + message("") endif() - - # find_file treats output as a standard variable from 3.21+ We get different behavior on later CMake versions. - if(${CMAKE_VERSION} VERSION_LESS "3.21.0") - unset(temp_abs_path CACHE) + else() # Includes are explicitly provided + # Check to be sure they exist + if(EXISTS ${${lib_name}_INCLUDE_DIR}) + message("Importing includes for ${lib_name}") + message("") else() - unset(temp_abs_path) + message(FATAL_ERROR "Include directories for ${lib_name} not found") endif() - - endforeach() - - # Register any libs/includes under a blt dir for later use/depends - blt_register_library(NAME blt_${lib_name} - INCLUDES ${${lib_name}_INCLUDES} - LIBRARIES ${${lib_name}_LIBRARIES} - TREAT_INCLUDES_AS_SYSTEM On - ) - - # Add the blt target to a list of libs that can be depended on - if (${lib_name}_ADD_BLT_TARGET) - list(APPEND spheral_blt_${target_type}_depends blt_${lib_name}) endif() - set(${lib_name}_DIR ${${lib_name}_DIR} PARENT_SCOPE) - set(${dep_list} ${${dep_list}} PARENT_SCOPE) - set(spheral_blt_${target_type}_depends ${spheral_blt_${target_type}_depends} PARENT_SCOPE) - - message("") - + blt_import_library(NAME ${lib_name} + TREAT_INCLUDES_AS_SYSTEM ON + INCLUDES ${${lib_name}_INCLUDE_DIR} + LIBRARIES ${${lib_name}_LIBRARIES} + EXPORTABLE ON) + get_target_property(_is_imported ${lib_name} IMPORTED) + if(NOT ${_is_imported}) + install(TARGETS ${lib_name} + EXPORT spheral_cxx-targets + DESTINATION lib/cmake) + endif() + set_target_properties(${lib_name} PROPERTIES EXPORT_NAME spheral::${lib_name}) endfunction() diff --git a/cmake/spheral_cxx-config.cmake.in b/cmake/spheral_cxx-config.cmake.in new file mode 100644 index 000000000..d982d2945 --- /dev/null +++ b/cmake/spheral_cxx-config.cmake.in @@ -0,0 +1,17 @@ + +@PACKAGE_INIT@ + +if(NOT axom_DIR) + set(axom_DIR "@axom_DIR@" CACHE PATH "") +endif() +set(SPHERAL_BLT_DIR "@SPHERAL_BLT_DIR@") +set(SPHERAL_CXX_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@") +set(SPHERAL_CXX_INCLUDE_DIRS "${SPHERAL_CXX_INSTALL_PREFIX}/include") +if(NOT TARGET axom) + find_package(axom REQUIRED QUIET NO_DEFAULT_PATH PATHS ${axom_DIR} ${axom_DIR}/lib ${axom_DIR}/lib/cmake) +endif() +include("${SPHERAL_CXX_INSTALL_PREFIX}/lib/cmake/spheral_cxx-targets.cmake") + +set_property(TARGET Spheral_CXX + APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${SPHERAL_CXX_INCLUDE_DIRS}) diff --git a/extern/PYB11Generator b/extern/PYB11Generator index e22a661a7..71608127d 160000 --- a/extern/PYB11Generator +++ b/extern/PYB11Generator @@ -1 +1 @@ -Subproject commit e22a661a73492d0d6e2ad109c6ff5ed9cf050ae3 +Subproject commit 71608127d276e9135c2c81d65bd0822adb006e91 diff --git a/extern/PolyClipper b/extern/PolyClipper index 038fb672d..68bde6c15 160000 --- a/extern/PolyClipper +++ b/extern/PolyClipper @@ -1 +1 @@ -Subproject commit 038fb672d6b21a345a8e33c5b4d6c1df068dcf11 +Subproject commit 68bde6c150a2f4d555011cbf52a6b3af6bf63d27 diff --git a/scripts/devtools/host-config-build.py b/scripts/devtools/host-config-build.py index 2c9336b1e..1990e5c82 100755 --- a/scripts/devtools/host-config-build.py +++ b/scripts/devtools/host-config-build.py @@ -19,6 +19,9 @@ def parse_args(): parser.add_argument('-i', '--install-dir', type=str, default="", help='Location of spheral source directory.') + parser.add_argument('--build-dir', type=str, default="", + help='Name of build directory.') + parser.add_argument('--no-clean', action='store_true', help='Do not delete build and install locations.') @@ -63,12 +66,15 @@ def main(): # Set up our directory structure paths. - build_dir="{0}/build_{1}/build".format(source_dir, hostconfig) + if not args.build_dir: + build_dir="{0}/build_{1}".format(source_dir, hostconfig) + else: + build_dir="{0}/{1}".format(source_dir, args.build_dir) if not args.install_dir: - install_dir="{0}/build_{1}/install".format(source_dir, hostconfig) + install_dir="{0}/install".format(build_dir) else: install_dir=args.install_dir - + build_dir=build_dir+"/build" # Pull the cmake command to use out of our host config. cmake_cmd=sexe("grep 'CMake executable' \"{0}\"".format(hostconfig_path), ret_output=True, echo=True)[1].split()[-1] diff --git a/scripts/spack/packages/spheral/package.py b/scripts/spack/packages/spheral/package.py index 5a75f5386..7f8fd6650 100644 --- a/scripts/spack/packages/spheral/package.py +++ b/scripts/spack/packages/spheral/package.py @@ -176,7 +176,7 @@ def initconfig_package_entries(self): entries.append(cmake_cache_path('silo_DIR', spec['silo'].prefix)) entries.append(cmake_cache_path('eigen_DIR', spec['eigen'].prefix)) - entries.append(cmake_cache_path('eigen_INCLUDES','$')) + entries.append(cmake_cache_path('eigen_INCLUDES',spec['eigen'].prefix.include.eigen3)) entries.append(cmake_cache_path('opensubdiv_DIR', spec['opensubdiv'].prefix)) diff --git a/src/ArtificialConduction/CMakeLists.txt b/src/ArtificialConduction/CMakeLists.txt index 6e3b4d4ba..6fd38fd1b 100644 --- a/src/ArtificialConduction/CMakeLists.txt +++ b/src/ArtificialConduction/CMakeLists.txt @@ -12,5 +12,5 @@ set(ArtificialConduction_headers ArtificialConductionPolicy.hh ) -spheral_add_obj_library(ArtificialConduction) +spheral_add_obj_library(ArtificialConduction SPHERAL_OBJ_LIBS) diff --git a/src/ArtificialViscosity/CMakeLists.txt b/src/ArtificialViscosity/CMakeLists.txt index f2ac2cfbf..96f7a50b5 100644 --- a/src/ArtificialViscosity/CMakeLists.txt +++ b/src/ArtificialViscosity/CMakeLists.txt @@ -50,5 +50,5 @@ set(ArtificialViscosity_headers VonNeumanViscosity.hh ) -spheral_add_obj_library(ArtificialViscosity) +spheral_add_obj_library(ArtificialViscosity SPHERAL_OBJ_LIBS) diff --git a/src/Boundary/CMakeLists.txt b/src/Boundary/CMakeLists.txt index a91f407bb..317e65231 100644 --- a/src/Boundary/CMakeLists.txt +++ b/src/Boundary/CMakeLists.txt @@ -80,5 +80,5 @@ set(Boundary_headers spheral_install_python_files(ExpandingDomain.py) -spheral_add_obj_library(Boundary) +spheral_add_obj_library(Boundary SPHERAL_OBJ_LIBS) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b15cd4de9..0f82c1da5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,7 +10,8 @@ include_directories(${PROJECT_BINARY_DIR}/src) set(SPHERAL_PYTHON_INSTALL ${PROJECT_BINARY_DIR}/lib) -list(APPEND _packages +# These are internal Spheral packages +list(APPEND _packages ArtificialViscosity ArtificialConduction Boundary @@ -48,10 +49,9 @@ list(APPEND _packages ) if(NOT ENABLE_CXXONLY) - list(APPEND _packages + list(APPEND _packages SimulationControl - PYB11 - ) + PYB11) endif() configure_file(config.hh.in @@ -61,13 +61,14 @@ foreach(_package ${_packages}) add_subdirectory(${_package}) endforeach() -include_directories(${extra_packages_DIR}) -foreach(e_package ${extra_packages}) - add_subdirectory(${extra_packages_DIR}/${e_package} ${CMAKE_CURRENT_BINARY_DIR}/${e_package}) -endforeach() +# Retrieve the global list populated in spheral_obj_add_library +get_property(SPHERAL_OBJ_LIBS GLOBAL PROPERTY SPHERAL_OBJ_LIBS) set(CXX_sources spheralCXX.cc) +# Must use quotes when passing lists as inputs for functions +spheral_add_cxx_library(CXX "${SPHERAL_OBJ_LIBS}") -spheral_add_cxx_library(CXX) - -install(EXPORT ${PROJECT_NAME}-targets DESTINATION Spheral/lib/cmake) +# This calls LLNLSpheralInstallObjs.cmake +if(EXISTS ${EXTERNAL_SPHERAL_OBJ_CMAKE}) + include(${EXTERNAL_SPHERAL_OBJ_CMAKE}) +endif() diff --git a/src/CRKSPH/CMakeLists.txt b/src/CRKSPH/CMakeLists.txt index 31714d995..c00c9e8e2 100644 --- a/src/CRKSPH/CMakeLists.txt +++ b/src/CRKSPH/CMakeLists.txt @@ -49,7 +49,7 @@ set(CRKSPH_headers zerothOrderSurfaceCorrections.hh ) -spheral_add_obj_library(CRKSPH) - +spheral_add_obj_library(CRKSPH SPHERAL_OBJ_LIBS) + spheral_install_python_files(CRKSPHHydros.py) diff --git a/src/CXXTests/DeviceTestLib/CMakeLists.txt b/src/CXXTests/DeviceTestLib/CMakeLists.txt index 2cd58ed35..b44e32e5d 100644 --- a/src/CXXTests/DeviceTestLib/CMakeLists.txt +++ b/src/CXXTests/DeviceTestLib/CMakeLists.txt @@ -14,5 +14,5 @@ set(DeviceTestLib_headers spheral_install_python_files( ) -spheral_add_obj_library(DeviceTestLib) +spheral_add_obj_library(DeviceTestLib SPHERAL_OBJ_LIBS) diff --git a/src/CXXTests/DeviceTestLib/DeviceTest.cc b/src/CXXTests/DeviceTestLib/DeviceTest.cc index 0954462cc..78fc8efb0 100644 --- a/src/CXXTests/DeviceTestLib/DeviceTest.cc +++ b/src/CXXTests/DeviceTestLib/DeviceTest.cc @@ -40,4 +40,4 @@ int launchCaller(int a, int b) #endif -} // namespace Spehral +} // namespace Spheral diff --git a/src/CXXTests/DeviceTestLib/DeviceTest.hh b/src/CXXTests/DeviceTestLib/DeviceTest.hh index a6778d0a1..232b98f67 100644 --- a/src/CXXTests/DeviceTestLib/DeviceTest.hh +++ b/src/CXXTests/DeviceTestLib/DeviceTest.hh @@ -17,6 +17,6 @@ int launchCaller(int a, int b); #endif -} // namespace Spehral +} // namespace Spheral #endif // __Spheral_DeviceTest_hh__ diff --git a/src/DEM/CMakeLists.txt b/src/DEM/CMakeLists.txt index cf2bcc1bb..28606c290 100644 --- a/src/DEM/CMakeLists.txt +++ b/src/DEM/CMakeLists.txt @@ -44,5 +44,5 @@ add_subdirectory(SolidBoundary) spheral_install_python_files(DEM.py) -spheral_add_obj_library(DEM) +spheral_add_obj_library(DEM SPHERAL_OBJ_LIBS) diff --git a/src/Damage/CMakeLists.txt b/src/Damage/CMakeLists.txt index 1da11e7d1..79d0f68ec 100644 --- a/src/Damage/CMakeLists.txt +++ b/src/Damage/CMakeLists.txt @@ -73,5 +73,5 @@ spheral_install_python_files( ShadowIvanoviSALEDamageModel.py ) -spheral_add_obj_library(Damage) +spheral_add_obj_library(Damage SPHERAL_OBJ_LIBS) diff --git a/src/DataBase/CMakeLists.txt b/src/DataBase/CMakeLists.txt index b1da8363c..419c38dd9 100644 --- a/src/DataBase/CMakeLists.txt +++ b/src/DataBase/CMakeLists.txt @@ -54,5 +54,5 @@ set(DataBase_headers UpdatePolicyBaseInline.hh ) -spheral_add_obj_library(DataBase) +spheral_add_obj_library(DataBase SPHERAL_OBJ_LIBS) diff --git a/src/DataOutput/CMakeLists.txt b/src/DataOutput/CMakeLists.txt index 49d5c3c50..2881ed602 100644 --- a/src/DataOutput/CMakeLists.txt +++ b/src/DataOutput/CMakeLists.txt @@ -14,5 +14,5 @@ set(DataOutput_headers registerWithRestart.hh ) -spheral_add_obj_library(DataOutput) +spheral_add_obj_library(DataOutput SPHERAL_OBJ_LIBS) diff --git a/src/Distributed/CMakeLists.txt b/src/Distributed/CMakeLists.txt index b3aabb706..60f123fb5 100644 --- a/src/Distributed/CMakeLists.txt +++ b/src/Distributed/CMakeLists.txt @@ -70,7 +70,7 @@ if (ENABLE_MPI) RENAME mpi.py ) - spheral_add_obj_library(Distributed) + spheral_add_obj_library(Distributed SPHERAL_OBJ_LIBS) else() #---------------------------------------------------------------------------- diff --git a/src/ExternalForce/CMakeLists.txt b/src/ExternalForce/CMakeLists.txt index bebadc89d..20318023a 100644 --- a/src/ExternalForce/CMakeLists.txt +++ b/src/ExternalForce/CMakeLists.txt @@ -27,5 +27,5 @@ set(ExternalForce_includes ) -spheral_add_obj_library(ExternalForce) +spheral_add_obj_library(ExternalForce SPHERAL_OBJ_LIBS) diff --git a/src/FSISPH/CMakeLists.txt b/src/FSISPH/CMakeLists.txt index be9de90e8..5c3bea7d5 100644 --- a/src/FSISPH/CMakeLists.txt +++ b/src/FSISPH/CMakeLists.txt @@ -28,5 +28,5 @@ spheral_install_python_files( SlideSurfaces.py ) -spheral_add_obj_library(FSISPH) +spheral_add_obj_library(FSISPH SPHERAL_OBJ_LIBS) diff --git a/src/Field/CMakeLists.txt b/src/Field/CMakeLists.txt index 76d12f4f1..697380162 100644 --- a/src/Field/CMakeLists.txt +++ b/src/Field/CMakeLists.txt @@ -45,5 +45,5 @@ set(Field_headers uvm_allocator.hh ) -spheral_add_obj_library(Field) +spheral_add_obj_library(Field SPHERAL_OBJ_LIBS) diff --git a/src/FieldOperations/CMakeLists.txt b/src/FieldOperations/CMakeLists.txt index 2a2728374..50664f4c8 100644 --- a/src/FieldOperations/CMakeLists.txt +++ b/src/FieldOperations/CMakeLists.txt @@ -40,5 +40,5 @@ set(FieldOperations_headers sampleMultipleFields2Lattice.hh ) -spheral_add_obj_library(FieldOperations) +spheral_add_obj_library(FieldOperations SPHERAL_OBJ_LIBS) diff --git a/src/FileIO/CMakeLists.txt b/src/FileIO/CMakeLists.txt index 098a1b265..214950459 100644 --- a/src/FileIO/CMakeLists.txt +++ b/src/FileIO/CMakeLists.txt @@ -30,5 +30,5 @@ spheral_install_python_files( PlyFileIO.py ) -spheral_add_obj_library(FileIO) +spheral_add_obj_library(FileIO SPHERAL_OBJ_LIBS) diff --git a/src/GSPH/CMakeLists.txt b/src/GSPH/CMakeLists.txt index 13a01ee97..8b409cb4d 100644 --- a/src/GSPH/CMakeLists.txt +++ b/src/GSPH/CMakeLists.txt @@ -59,5 +59,5 @@ instantiate(GSPH_inst GSPH_sources) spheral_install_python_files(GSPHHydros.py) -spheral_add_obj_library(GSPH) +spheral_add_obj_library(GSPH SPHERAL_OBJ_LIBS) diff --git a/src/Geometry/CMakeLists.txt b/src/Geometry/CMakeLists.txt index 13976ece0..884d2917e 100644 --- a/src/Geometry/CMakeLists.txt +++ b/src/Geometry/CMakeLists.txt @@ -100,5 +100,5 @@ set(Geometry_headers outerProduct.hh ) -spheral_add_obj_library(Geometry) +spheral_add_obj_library(Geometry SPHERAL_OBJ_LIBS) diff --git a/src/Gravity/CMakeLists.txt b/src/Gravity/CMakeLists.txt index 14323dd77..f9c8bf241 100644 --- a/src/Gravity/CMakeLists.txt +++ b/src/Gravity/CMakeLists.txt @@ -23,5 +23,5 @@ set(Gravity_headers PolyGravity.hh ) -spheral_add_obj_library(Gravity) +spheral_add_obj_library(Gravity SPHERAL_OBJ_LIBS) diff --git a/src/Hydro/CMakeLists.txt b/src/Hydro/CMakeLists.txt index 95f8fdaae..0426dbbb1 100644 --- a/src/Hydro/CMakeLists.txt +++ b/src/Hydro/CMakeLists.txt @@ -59,5 +59,5 @@ set(Hydro_headers entropyWeightingFunction.hh ) -spheral_add_obj_library(Hydro) +spheral_add_obj_library(Hydro SPHERAL_OBJ_LIBS) diff --git a/src/Integrator/CMakeLists.txt b/src/Integrator/CMakeLists.txt index e0a445f3c..2e117f3e3 100644 --- a/src/Integrator/CMakeLists.txt +++ b/src/Integrator/CMakeLists.txt @@ -24,5 +24,5 @@ set(Integrator_headers Verlet.hh ) -spheral_add_obj_library(Integrator) +spheral_add_obj_library(Integrator SPHERAL_OBJ_LIBS) diff --git a/src/Kernel/CMakeLists.txt b/src/Kernel/CMakeLists.txt index 8c3769403..05a14f95c 100644 --- a/src/Kernel/CMakeLists.txt +++ b/src/Kernel/CMakeLists.txt @@ -68,5 +68,5 @@ set(Kernel_headers WendlandC6KernelInline.hh ) -spheral_add_obj_library(Kernel) +spheral_add_obj_library(Kernel SPHERAL_OBJ_LIBS) diff --git a/src/KernelIntegrator/CMakeLists.txt b/src/KernelIntegrator/CMakeLists.txt index db1291dfe..d636e874c 100644 --- a/src/KernelIntegrator/CMakeLists.txt +++ b/src/KernelIntegrator/CMakeLists.txt @@ -39,4 +39,4 @@ set(KernelIntegrator_headers SymmetricTriangularValues.hh ) -spheral_add_obj_library(KernelIntegrator) +spheral_add_obj_library(KernelIntegrator SPHERAL_OBJ_LIBS) diff --git a/src/Material/CMakeLists.txt b/src/Material/CMakeLists.txt index 3a2070726..d09520c72 100644 --- a/src/Material/CMakeLists.txt +++ b/src/Material/CMakeLists.txt @@ -42,5 +42,5 @@ endif() instantiate(Material_inst Material_sources) -spheral_add_obj_library(Material) +spheral_add_obj_library(Material SPHERAL_OBJ_LIBS) diff --git a/src/Mesh/CMakeLists.txt b/src/Mesh/CMakeLists.txt index 9f5a368ca..d7e739aea 100644 --- a/src/Mesh/CMakeLists.txt +++ b/src/Mesh/CMakeLists.txt @@ -54,5 +54,5 @@ spheral_install_python_files( siloMeshDump.py ) -spheral_add_obj_library(Mesh) +spheral_add_obj_library(Mesh SPHERAL_OBJ_LIBS) diff --git a/src/Neighbor/CMakeLists.txt b/src/Neighbor/CMakeLists.txt index 324669873..240cbd71f 100644 --- a/src/Neighbor/CMakeLists.txt +++ b/src/Neighbor/CMakeLists.txt @@ -30,5 +30,5 @@ set(Neighbor_headers TreeNeighbor.hh ) -spheral_add_obj_library(Neighbor) +spheral_add_obj_library(Neighbor SPHERAL_OBJ_LIBS) diff --git a/src/NodeGenerators/CMakeLists.txt b/src/NodeGenerators/CMakeLists.txt index a63425f5c..527cbda96 100644 --- a/src/NodeGenerators/CMakeLists.txt +++ b/src/NodeGenerators/CMakeLists.txt @@ -69,5 +69,5 @@ spheral_install_python_files( GenerateSphericalNodeDistribution1d.py ) -spheral_add_obj_library(NodeGenerators) +spheral_add_obj_library(NodeGenerators SPHERAL_OBJ_LIBS) diff --git a/src/NodeList/CMakeLists.txt b/src/NodeList/CMakeLists.txt index be4853434..a14e11b8a 100644 --- a/src/NodeList/CMakeLists.txt +++ b/src/NodeList/CMakeLists.txt @@ -46,5 +46,5 @@ spheral_install_python_files( DEMNodeLists.py ) -spheral_add_obj_library(NodeList) +spheral_add_obj_library(NodeList SPHERAL_OBJ_LIBS) diff --git a/src/Physics/CMakeLists.txt b/src/Physics/CMakeLists.txt index 23395b992..14b36e89c 100644 --- a/src/Physics/CMakeLists.txt +++ b/src/Physics/CMakeLists.txt @@ -17,5 +17,5 @@ set(Physics_headers PhysicsInline.hh ) -spheral_add_obj_library(Physics) +spheral_add_obj_library(Physics SPHERAL_OBJ_LIBS) diff --git a/src/RK/CMakeLists.txt b/src/RK/CMakeLists.txt index 185df0007..b249d3c3f 100644 --- a/src/RK/CMakeLists.txt +++ b/src/RK/CMakeLists.txt @@ -61,5 +61,5 @@ set(RK_headers interpolateRK.hh ) -spheral_add_obj_library(RK) +spheral_add_obj_library(RK SPHERAL_OBJ_LIBS) diff --git a/src/SPH/CMakeLists.txt b/src/SPH/CMakeLists.txt index eace4fd15..928411ad9 100644 --- a/src/SPH/CMakeLists.txt +++ b/src/SPH/CMakeLists.txt @@ -63,5 +63,5 @@ spheral_install_python_files( FacetedSurfaceASPHHydro.py ) -spheral_add_obj_library(SPH) +spheral_add_obj_library(SPH SPHERAL_OBJ_LIBS) diff --git a/src/SVPH/CMakeLists.txt b/src/SVPH/CMakeLists.txt index 42b6034f1..379041512 100644 --- a/src/SVPH/CMakeLists.txt +++ b/src/SVPH/CMakeLists.txt @@ -42,5 +42,5 @@ set(SVPH_headers spheral_install_python_files(SVPHHydros.py) -spheral_add_obj_library(SVPH) +spheral_add_obj_library(SVPH SPHERAL_OBJ_LIBS) diff --git a/src/SolidMaterial/CMakeLists.txt b/src/SolidMaterial/CMakeLists.txt index fdd835333..12feb90bc 100644 --- a/src/SolidMaterial/CMakeLists.txt +++ b/src/SolidMaterial/CMakeLists.txt @@ -82,5 +82,5 @@ instantiate(SolidMaterial_inst SolidMaterial_sources) # Ignore -W-maybe-uninitialized warnings thrown from bisectSearch for possibly uninitialized iterators from boost multi-array. set_source_files_properties(ANEOSInst1d.cc ANEOSInst2d.cc ANEOSInst3d.cc PROPERTIES COMPILE_FLAGS "$<$:-Wno-uninitialized>") -spheral_add_obj_library(SolidMaterial) +spheral_add_obj_library(SolidMaterial SPHERAL_OBJ_LIBS) diff --git a/src/Strength/CMakeLists.txt b/src/Strength/CMakeLists.txt index 66cf309ae..e920f776c 100644 --- a/src/Strength/CMakeLists.txt +++ b/src/Strength/CMakeLists.txt @@ -27,5 +27,5 @@ set(Strength_headers effectiveKernelVolume.hh ) -spheral_add_obj_library(Strength) +spheral_add_obj_library(Strength SPHERAL_OBJ_LIBS) diff --git a/src/Utilities/CMakeLists.txt b/src/Utilities/CMakeLists.txt index 196e15bda..f8890cf2f 100644 --- a/src/Utilities/CMakeLists.txt +++ b/src/Utilities/CMakeLists.txt @@ -140,5 +140,5 @@ set(Utilities_headers spheral_install_python_files(fitspline.py) -spheral_add_obj_library(Utilities) +spheral_add_obj_library(Utilities SPHERAL_OBJ_LIBS)