Skip to content

Commit

Permalink
move target logic into test cmakelist
Browse files Browse the repository at this point in the history
  • Loading branch information
jonahm-LANL committed Aug 29, 2024
1 parent daee8bf commit 591d5f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ cmake_minimum_required(VERSION 3.14)
set(PORTS_OF_CALL_VERSION 1.6.0)
project(ports-of-call VERSION ${PORTS_OF_CALL_VERSION})

# dependent options
include(CMakeDependentOption)

# CMAKE WARMUP
# ----------------------------------------

Expand All @@ -32,6 +35,10 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
endif()

option (PORTS_OF_CALL_BUILD_TESTING "Test the current installation")
# off by default but possible to turn on
cmake_dependent_option(PORTS_OF_CALL_TEST_USE_KOKKOS
"Use Kokkos offloading for tests"
OFF "PORTS_OF_CALL_BUILD_TESTING" OFF)

# CONFIGURATION LOGIC
# ----------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ endif()
# this interface target is to collect
# compile/link options for the test
add_library(portsofcall_iface INTERFACE)
if (PORTABILITY_STRATEGY_KOKKOS)
if (PORTS_OF_CALL_TEST_USE_KOKKOS)
if(NOT TARGET Kokkos::kokkos)
find_package(Kokkos REQUIRED)
endif()
Expand Down

0 comments on commit 591d5f2

Please sign in to comment.