Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CMake #59

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,11 @@ endif(RESOLVE_USE_HIP)
configure_file(
${CMAKE_SOURCE_DIR}/resolve/resolve_defs.hpp.in
${CMAKE_BINARY_DIR}/resolve/resolve_defs.hpp)

# include build directory for Fortran name mangling header
# TODO - target based includes
include_directories(${CMAKE_BINARY_DIR})

install(
FILES ${CMAKE_BINARY_DIR}/resolve/resolve_defs.hpp
DESTINATION include/resolve
)

# TODO - fix this
include_directories(${CMAKE_SOURCE_DIR})

# Enable testing
enable_testing()
Expand Down
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
cameronrutherford marked this conversation as resolved.
Show resolved Hide resolved
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
7 changes: 1 addition & 6 deletions resolve/cpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ set(ReSolve_CPU_HEADER_INSTALL

# First create dummy backend
add_library(resolve_backend_cpu SHARED ${ReSolve_CPU_SRC})
target_link_libraries(resolve_backend_cpu PRIVATE resolve_logger)

target_include_directories(resolve_backend_cpu INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
)
target_link_libraries(resolve_backend_cpu PUBLIC resolve_logger)

# install include headers
install(FILES ${ReSolve_CPU_HEADER_INSTALL} DESTINATION include/resolve/cpu)
5 changes: 3 additions & 2 deletions resolve/utilities/logger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ set(Logger_HEADER_INSTALL
# Build shared library ReSolve
add_library(resolve_logger SHARED ${Logger_SRC})

target_include_directories(resolve_logger INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
target_include_directories(resolve_logger PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
)

Expand Down
7 changes: 4 additions & 3 deletions resolve/workspace/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ if(RESOLVE_USE_HIP)
target_link_libraries(resolve_workspace PUBLIC resolve_backend_hip)
endif(RESOLVE_USE_HIP)

target_include_directories(resolve_workspace INTERFACE
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
$<INSTALL_INTERFACE:include>
target_include_directories(resolve_workspace PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
)

# install include headers
Expand Down