Skip to content

Commit

Permalink
Fix exported CMake bug in CXX_STANDARD
Browse files Browse the repository at this point in the history
  • Loading branch information
Rutherford, Cameron committed Nov 2, 2023
1 parent 508bd81 commit 8fcca3e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"installDir": "${sourceDir}/install",
"generator": "Unix Makefiles"
},
{
{
"name": "ascent",
"inherits": "cuda",
"displayName": "Ascent Build",
Expand Down
4 changes: 4 additions & 0 deletions cmake/ReSolveConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

include("${CMAKE_CURRENT_LIST_DIR}/ReSolveTargets.cmake")

if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD @CMAKE_CXX_STANDARD@)
endif()

include(CheckLanguage)
# This must come before enable_language(CUDA)
if(@RESOLVE_USE_CUDA@)
Expand Down
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ set(CONSUMER_PATH ${CMAKE_INSTALL_PREFIX}/share/examples)
install(PROGRAMS test.sh DESTINATION ${CONSUMER_PATH})

# Select consumer app
# TODO - have an outer loop that adds a unique consumer test for each backend supproted
if(RESOLVE_USE_CUDA)
set(RESOLVE_CONSUMER_APP "testKLU_Rf_FGMRES.cpp")
elseif(RESOLVE_USE_HIP)
set(RESOLVE_CONSUMER_APP "testKLU_RocSolver.cpp")
else()
set(RESOLVE_CONSUMER_APP "testKLU.cpp")
endif()
Expand Down
2 changes: 1 addition & 1 deletion examples/resolve_consumer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ find_package(ReSolve REQUIRED)

# Build example with KLU factorization and KLU refactorization
add_executable(consume.exe consumer.cpp)
target_link_libraries(consume.exe PRIVATE ReSolve::ReSolve)
target_link_libraries(consume.exe PUBLIC ReSolve::ReSolve)

#------------------------------------------------------------------------------------
# Testing of exported Resolve Configurations
Expand Down

0 comments on commit 8fcca3e

Please sign in to comment.