Skip to content

Commit

Permalink
Reformating CMake files.
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricchevalier19 committed Apr 11, 2024
1 parent 652a3f5 commit c840c1b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 36 deletions.
60 changes: 30 additions & 30 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,61 +38,61 @@ set(KOKKOSCOMM_VERSION_MINOR ${CMAKE_PROJECT_VERSION_MINOR} CACHE STRING "" FORC
set(KOKKOSCOMM_VERSION_PATCH ${CMAKE_PROJECT_VERSION_PATCH} CACHE STRING "" FORCE)

configure_file(
${CMAKE_CURRENT_LIST_DIR}/cmake/KokkosComm_configuration.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/src/KokkosComm_configuration.hpp
@ONLY
${CMAKE_CURRENT_LIST_DIR}/cmake/KokkosComm_configuration.hpp.in
${CMAKE_CURRENT_BINARY_DIR}/src/KokkosComm_configuration.hpp
@ONLY
)


target_include_directories(KokkosComm INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src/>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

## Package config file
include(CMakePackageConfigHelpers)
configure_package_config_file(
${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in
${PROJECT_BINARY_DIR}/cmake/KokkosComm/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in
${PROJECT_BINARY_DIR}/cmake/KokkosComm/${PROJECT_NAME}Config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
NO_SET_AND_CHECK_MACRO
NO_CHECK_REQUIRED_COMPONENTS_MACRO
)

write_basic_package_version_file(
${PROJECT_BINARY_DIR}/cmake/KokkosComm/${PROJECT_NAME}Version.cmake
COMPATIBILITY SameMajorVersion
${PROJECT_BINARY_DIR}/cmake/KokkosComm/${PROJECT_NAME}Version.cmake
COMPATIBILITY SameMajorVersion
)

export(
TARGETS KokkosComm KokkosCommFlags
NAMESPACE "${PROJECT_NAME}::"
FILE ${PROJECT_BINARY_DIR}/cmake/KokkosComm/KokkosCommTargets.cmake
TARGETS KokkosComm KokkosCommFlags
NAMESPACE "${PROJECT_NAME}::"
FILE ${PROJECT_BINARY_DIR}/cmake/KokkosComm/KokkosCommTargets.cmake
)

install(
TARGETS KokkosComm KokkosCommFlags
EXPORT KokkosCommTargets # does this do anything?
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
TARGETS KokkosComm KokkosCommFlags
EXPORT KokkosCommTargets # does this do anything?
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

install(
DIRECTORY "${PROJECT_BINARY_DIR}/src/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.hpp")
DIRECTORY "${PROJECT_BINARY_DIR}/src/"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.hpp")

install(
FILES
"${PROJECT_BINARY_DIR}/cmake/KokkosComm/KokkosCommConfig.cmake"
"${PROJECT_BINARY_DIR}/cmake/KokkosComm/KokkosCommVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/KokkosComm/
FILES
"${PROJECT_BINARY_DIR}/cmake/KokkosComm/KokkosCommConfig.cmake"
"${PROJECT_BINARY_DIR}/cmake/KokkosComm/KokkosCommVersion.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/KokkosComm/
)

install(
EXPORT KokkosCommTargets
NAMESPACE "${PROJECT_NAME}::"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
EXPORT KokkosCommTargets
NAMESPACE "${PROJECT_NAME}::"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
)


Expand Down
4 changes: 2 additions & 2 deletions perf_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include(FetchContent)

# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
cmake_policy(SET CMP0135 NEW)
endif()

set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
Expand All @@ -41,4 +41,4 @@ add_executable(perf_test-main test_main.cpp

target_link_libraries(perf_test-main KokkosComm::KokkosComm benchmark::benchmark)
add_test(NAME perf_test-main
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./perf_test-main)
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./perf_test-main)
8 changes: 4 additions & 4 deletions unit_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include(FetchContent)

# Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24:
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
cmake_policy(SET CMP0135 NEW)
cmake_policy(SET CMP0135 NEW)
endif()

FetchContent_Declare(
Expand All @@ -36,10 +36,10 @@ endif()
# Standalone MPI smoke tests (do not use KokkosComm)
add_executable(test-mpi test_mpi.cpp)
add_test(NAME test-mpi-1
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 1 ./test-mpi
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 1 ./test-mpi
)
add_test(NAME test-mpi-2
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./test-mpi
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./test-mpi
)
# doesn't use KokkosComm, so explicitly link MPI
target_link_libraries(test-mpi MPI::MPI_CXX)
Expand All @@ -53,5 +53,5 @@ add_executable(test-main test_main.cpp
target_link_libraries(test-main KokkosComm::KokkosComm gtest)

add_test(NAME test-main
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./test-main
COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} 2 ./test-main
)

0 comments on commit c840c1b

Please sign in to comment.