Skip to content

Commit

Permalink
CMake: add CUDA-support to plotfile tools build. It fixes issue AMReX…
Browse files Browse the repository at this point in the history
  • Loading branch information
mic84 committed Apr 8, 2020
1 parent a82d630 commit 5fb3be5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Tools/Plotfile/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,20 @@ set(_exe_names
foreach( _exe IN LISTS _exe_names)
add_executable(${_exe} ${_exe}.cpp)
target_link_libraries(${_exe} PRIVATE amrex)
if (ENABLE_CUDA)
set_source_files_properties(${_exe}.cpp PROPERTIES LANGUAGE CUDA)
endif()
add_dependencies(plotfile_tools ${_exe})
endforeach()


# target snapshot needs a special treatment
target_include_directories(fsnapshot PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_sources(fsnapshot PRIVATE AMReX_PPMUtil.H AMReX_PPMUtil.cpp)
if (ENABLE_CUDA)
set_source_files_properties(AMReX_PPMUtil.cpp PROPERTIES LANGUAGE CUDA)
target_compile_features(fsnapshot PUBLIC cxx_std_14)
endif()

# Installation
install(TARGETS ${_exe_names} RUNTIME DESTINATION bin)

0 comments on commit 5fb3be5

Please sign in to comment.