Skip to content

Commit

Permalink
Cleanup CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Jul 9, 2024
1 parent 266b72a commit 07818f9
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 25 deletions.
25 changes: 2 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,12 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

option(PFFDTD_ENABLE_SYCL "Build with sycl" OFF)

add_executable(pffdtd)
target_compile_definitions(pffdtd PRIVATE PRECISION=2 USING_CUDA=0)
target_sources(pffdtd
PRIVATE
src/native/cpu_engine.cpp
src/native/cpu_engine.hpp
src/native/fdtd_common.cpp
src/native/fdtd_common.hpp
src/native/fdtd_data.cpp
src/native/fdtd_data.hpp
src/native/helper_funcs.cpp
src/native/helper_funcs.hpp
src/native/main.cpp
)

find_package(HDF5 REQUIRED)
target_link_libraries(pffdtd PRIVATE HDF5::HDF5)

find_package(OpenMP REQUIRED)
target_link_libraries(pffdtd PRIVATE OpenMP::OpenMP_CXX)

if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(pffdtd PRIVATE /W4)
else ()
target_compile_options(pffdtd PRIVATE -Wno-deprecated-declarations)
endif ()
add_subdirectory(src/3D)

if(PFFDTD_ENABLE_SYCL)
find_package(IntelSYCL REQUIRED)
add_subdirectory(src/2D)
endif()
2 changes: 0 additions & 2 deletions src/2D/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
project(pffdtd_2d)

find_package(IntelSYCL REQUIRED)

add_executable(pffdtd_2d)
target_sources(pffdtd_2d PRIVATE fdtd.cpp)
add_sycl_to_target(TARGET pffdtd_2d SOURCES fdtd.cpp)
Expand Down
26 changes: 26 additions & 0 deletions src/3D/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
project(pffdtd_3d)

add_executable(pffdtd_3d)
target_compile_definitions(pffdtd_3d PRIVATE PRECISION=2 USING_CUDA=0)
target_sources(pffdtd_3d
PRIVATE
cpu_engine.cpp
cpu_engine.hpp
fdtd_common.cpp
fdtd_common.hpp
fdtd_data.cpp
fdtd_data.hpp
helper_funcs.cpp
helper_funcs.hpp
main.cpp
)


target_link_libraries(pffdtd_3d PRIVATE HDF5::HDF5)
target_link_libraries(pffdtd_3d PRIVATE OpenMP::OpenMP_CXX)

if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(pffdtd_3d PRIVATE /W4)
else ()
target_compile_options(pffdtd_3d PRIVATE -Wno-deprecated-declarations)
endif ()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 07818f9

Please sign in to comment.