Skip to content

Commit

Permalink
Move dockerfile to dedicated docker directory
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenarnst committed Jun 14, 2024
1 parent f4be417 commit 1fadc6e
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.ref == 'refs/heads/develop' }}
file: dockerfile
file: docker/dockerfile
tags: ${{ needs.set-vars.outputs.CI_IMAGE }}
cache-from: type=registry,ref=${{ needs.set-vars.outputs.CI_IMAGE }}
cache-to: type=inline
Expand Down
42 changes: 20 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ file(READ version.json VERSION_JSON)

string(JSON KOKKOS_UTILS_VERSION GET "${VERSION_JSON}" "kokkos-utils" "value")

string(JSON DOXYGEN_VERSION GET "${VERSION_JSON}" dependencies doxygen value)
string(JSON GOOGLETEST_VERSION GET "${VERSION_JSON}" dependencies googletest value)
string(JSON KOKKOS_VERSION GET "${VERSION_JSON}" dependencies kokkos value)
string(JSON Doxygen_REQUIRED_VERSION GET "${VERSION_JSON}" dependencies doxygen value)
string(JSON GTest_REQUIRED_VERSION GET "${VERSION_JSON}" dependencies googletest value)
string(JSON Kokkos_REQUIRED_VERSION GET "${VERSION_JSON}" dependencies kokkos value)

#---- Define the project. It uses C++ only.
project(
Expand All @@ -17,28 +17,29 @@ project(
)

#---- Options.
option(KOKKOSUTILS_ENABLE_TESTS "Enable testing" ON)
option(KOKKOSUTILS_ENABLE_DOC "Enable documentation" ON)
option(KokkosUtils_ENABLE_TESTS "Enable testing" ON)
option(KokkosUtils_ENABLE_DOC "Enable documentation" ON)

#---- Global property that helps us keep track of files that will automatically be added
# to our Doxygen documentation.
define_property(GLOBAL PROPERTY FILES_FOR_DOC
define_property(GLOBAL PROPERTY KokkosUtils_FILES_FOR_DOC
BRIEF_DOCS "Files that will be added to the Doxygen documentation."
)

#---- Find Kokkos.
#
# Currently, we require the Kokkos::kokkoscore target. Other targets will be added as needed.
if(NOT TARGET Kokkos::kokkoscore OR NOT T)
if(NOT TARGET Kokkos::kokkoscore)
find_package(
Kokkos
${KOKKOS_VERSION}
${Kokkos_REQUIRED_VERSION}
CONFIG
REQUIRED
)
endif()
if(NOT TARGET Kokkos::kokkoscore)
message(FATAL_ERROR "Kokkos should define a Kokkos::kokkoscore target.")
else()
if(NOT Kokkos_VERSION VERSION_GREATER_EQUAL Kokkos_REQUIRED_VERSION)
message(FATAL_ERROR "Kokkos version should be at least ${Kokkos_REQUIRED_VERSION}.")
endif()
endif()

#---- Find Google Test.
Expand All @@ -47,13 +48,14 @@ endif()
if(NOT TARGET GTest::gtest_main)
find_package(
GTest
${GOOGLETEST_VERSION}
${GTest_REQUIRED_VERSION}
CONFIG
REQUIRED
)
endif()
if(NOT TARGET GTest::gtest_main)
message(FATAL_ERROR "Googletest should define a GTest::gtest_main target.")
else()
if(NOT GTest_VERSION VERSION_GREATER_EQUAL GTest_REQUIRED_VERSION)
message(FATAL_ERROR "Google Test version should be at least ${GTest_REQUIRED_VERSION}.")
endif()
endif()

#---- Build the Kokkos::utils library.
Expand All @@ -63,11 +65,7 @@ add_library(Kokkos::utils ALIAS KokkosUtils)
target_sources(
KokkosUtils
INTERFACE
#FILE_SET concepts
#TYPE HEADERS
#BASE_DIRS include/kokkos-utils
#FILES
include/kokkos-utils/concepts/View.hpp
include/kokkos-utils/concepts/View.hpp
)

target_include_directories(
Expand All @@ -89,12 +87,12 @@ target_compile_definitions(
)

#---- Testing.
if(KOKKOSUTILS_ENABLE_TESTS)
if(KokkosUtils_ENABLE_TESTS)
enable_testing()
add_subdirectory(tests)
endif()

#---- Documentation.
if(KOKKOSUTILS_ENABLE_DOC)
if(KokkosUtils_ENABLE_DOC)
add_subdirectory(docs)
endif()
File renamed without changes.
18 changes: 11 additions & 7 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
if(NOT TARGET Doxygen::doxygen)
find_package(
Doxygen
${DOXYGEN_VERSION}
${Doxygen_REQUIRED_VERSION}
REQUIRED
)
else()
if(NOT Doxygen_VERSION VERSION_GREATER_EQUAL Doxygen_REQUIRED_VERSION)
message(FATAL_ERROR "Doxygen version should be at least ${Doxygen_REQUIRED_VERSION}.")
endif()
endif()

#---- Our 'homepage' is the README file.
Expand All @@ -18,8 +22,8 @@ set(DOXYGEN_SOURCE_BROWSER YES)
set(DOXYGEN_WARN_IF_UNDOCUMENTED NO)

#---- Extract files for documentation.
get_target_property(KokkosUtils_FILES_FOR_DOC KokkosUtils INTERFACE_SOURCES)
get_property(FILES_FOR_DOC GLOBAL PROPERTY FILES_FOR_DOC)
get_target_property(KokkosUtils_TARGET_FILES_FOR_DOC KokkosUtils INTERFACE_SOURCES)
get_property(KokkosUtils_FILES_FOR_DOC GLOBAL PROPERTY KokkosUtils_FILES_FOR_DOC)

#---- Add Doxygen as a target.
# See also https://cmake.org/cmake/help/latest/module/FindDoxygen.html.
Expand All @@ -29,11 +33,11 @@ doxygen_add_docs(
# Homepage
${HOMEPAGE_MD}

# Headers from KokkosUtils library
${KokkosUtils_FILES_FOR_DOC}
# Headers from our KokkosUtils library target
${KokkosUtils_TARGET_FILES_FOR_DOC}

# Files added to the global property FILES_FOR_DOC
${FILES_FOR_DOC}
# Files added to the global property KokkosUtils_FILES_FOR_DOC
${KokkosUtils_FILES_FOR_DOC}

# Files NOT added to the global property FILES_FOR_DOC
${CMAKE_SOURCE_DIR}/docs/tests.dox
Expand Down
2 changes: 1 addition & 1 deletion docs/tests.dox
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* @{
* @defgroup unittests Unit tests
* @}
*/
*/
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function(add_one_test)
cmake_path(ABSOLUTE_PATH SOURCE_FILE)

# Add source file to the documentation list.
set_property(GLOBAL APPEND PROPERTY FILES_FOR_DOC ${SOURCE_FILE})
set_property(GLOBAL APPEND PROPERTY KokkosUtils_FILES_FOR_DOC ${SOURCE_FILE})

# Create test executable.
add_executable(${EXECUTABLE_NAME})
Expand Down
2 changes: 1 addition & 1 deletion tests/concepts/test_View.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ using execution_space = Kokkos::DefaultExecutionSpace;
/**
* @file
*
* **View**
* **Concepts related to @c Kokkos::View**
*
* This group of tests check the behavior of our concepts related to @c Kokkos::View.
*/
Expand Down

0 comments on commit 1fadc6e

Please sign in to comment.