Skip to content

Commit

Permalink
apply formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
gardner48 committed Jun 21, 2024
1 parent 734822f commit 34b2752
Show file tree
Hide file tree
Showing 53 changed files with 2,386 additions and 1,452 deletions.
62 changes: 26 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,15 @@ project(SUNDIALS C)

# Specify the location of additional CMAKE modules
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
${PROJECT_SOURCE_DIR}/cmake
${PROJECT_SOURCE_DIR}/cmake/macros
${PROJECT_SOURCE_DIR}/cmake/tpl
)
${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake
${PROJECT_SOURCE_DIR}/cmake/macros ${PROJECT_SOURCE_DIR}/cmake/tpl)

# MACRO definitions
include(SundialsCMakeMacros)
include(CMakePrintHelpers)
include(CheckCSourceCompiles)
include(FindPackageHandleStandardArgs)


# Set some variables with info on the SUNDIALS project
set(PACKAGE_BUGREPORT "[email protected]")
set(PACKAGE_NAME "SUNDIALS")
Expand Down Expand Up @@ -133,23 +129,28 @@ mark_as_advanced(CLEAR CMAKE_INSTALL_INCLUDEDIR)
# Suffixes to use for static and shared targets.
set(_STATIC_LIB_SUFFIX
"_static"
CACHE INTERNAL "" FORCE
)
CACHE INTERNAL "" FORCE)
set(_SHARED_LIB_SUFFIX
"_shared"
CACHE INTERNAL "" FORCE
)
CACHE INTERNAL "" FORCE)

# A list of all the alias targets created.
set(_SUNDIALS_ALIAS_TARGETS ""
set(_SUNDIALS_ALIAS_TARGETS
""
CACHE INTERNAL "" FORCE)

# We default to release builds
set(_DEFAULT_CMAKE_BUILD_TYPE RelWithDebInfo)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Building SUNDIALS in '${_DEFAULT_CMAKE_BUILD_TYPE}' mode as CMAKE_BUILD_TYPE was not specified.")
set(CMAKE_BUILD_TYPE "${_DEFAULT_CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
message(
STATUS
"Building SUNDIALS in '${_DEFAULT_CMAKE_BUILD_TYPE}' mode as CMAKE_BUILD_TYPE was not specified."
)
set(CMAKE_BUILD_TYPE
"${_DEFAULT_CMAKE_BUILD_TYPE}"
CACHE STRING "Choose the type of build." FORCE)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
else()
message(STATUS "Building SUNDIALS in '${CMAKE_BUILD_TYPE}' mode.")
endif()
Expand Down Expand Up @@ -231,13 +232,11 @@ endif()

# install sundials_export header file
install(FILES "${PROJECT_BINARY_DIR}/include/sundials/sundials_export.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials"
)
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials")

# install configured header file
install(FILES "${PROJECT_BINARY_DIR}/include/sundials/sundials_config.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials"
)
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials")

# install shared Fortran 2003 modules
if(BUILD_FORTRAN_MODULE_INTERFACE)
Expand All @@ -246,53 +245,44 @@ if(BUILD_FORTRAN_MODULE_INTERFACE)
# of the .mod files.
if(BUILD_STATIC_LIBS)
install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}_STATIC/
DESTINATION ${Fortran_INSTALL_MODDIR}
)
DESTINATION ${Fortran_INSTALL_MODDIR})
else()
install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}_SHARED/
DESTINATION ${Fortran_INSTALL_MODDIR}
)
DESTINATION ${Fortran_INSTALL_MODDIR})
endif()
endif()

# install license and notice files
install(FILES "${PROJECT_SOURCE_DIR}/LICENSE"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials"
)
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials")
install(FILES "${PROJECT_SOURCE_DIR}/NOTICE"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials"
)
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/sundials")

# create package version file
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
SUNDIALSConfigVersion.cmake
VERSION ${PACKAGE_VERSION}
COMPATIBILITY AnyNewerVersion
)
COMPATIBILITY AnyNewerVersion)

# install targets
install(
EXPORT sundials-targets
FILE SUNDIALSTargets.cmake
NAMESPACE SUNDIALS::
DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}"
)
DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}")

# install SUNDIALSConfig.cmake
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/SUNDIALSConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSConfig.cmake"
INSTALL_DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}"
)
INSTALL_DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSConfigVersion.cmake"
DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}"
)
DESTINATION "${SUNDIALS_INSTALL_CMAKEDIR}")

# Export targets so build directory can be used directly
export(
EXPORT sundials-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/SUNDIALSTargets.cmake"
NAMESPACE SUNDIALS::
)
NAMESPACE SUNDIALS::)
Loading

0 comments on commit 34b2752

Please sign in to comment.