-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
53 lines (42 loc) · 1.62 KB
/
Copy pathCMakeLists.txt
File metadata and controls
53 lines (42 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
cmake_minimum_required(VERSION 3.19)
project(polyMPO VERSION 0.1.0 LANGUAGES CXX Fortran)
include(cmake/bob.cmake)
bob_begin_package()
include(CTest)
enable_testing()
enable_language(C)
macro(polyMPO_export_lib target headers)
bob_export_target(${target})
install(FILES ${headers} DESTINATION include)
endmacro(polyMPO_export_lib)
#pumipic dependency
set(CMAKE_CXX_EXTENSIONS Off) #kokkos does not allow extensions
message(STATUS "Found PUMIpic: ${pumipic_VERSION}")
set(polyMPO_USE_pumipic_DEFAULT ON)
bob_public_dep(pumipic)
#Clear the omegah compilation flags that it passes to cuda. Using the
# kokkos target, and nvcc_wrapper, provide sufficient flags.
set_property(TARGET Omega_h::omega_h PROPERTY INTERFACE_COMPILE_OPTIONS "")
#kokkos - pumipic should provide this
set(polyMPO_USE_Kokkos_DEFAULT ON)
bob_public_dep(Kokkos)
# Set a default build type if none was specified
# from: https://www.kitware.com/cmake-and-the-default-build-type/
set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
endif()
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
#install fortran module files
set(CMAKE_Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/mod_files)
install(DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/ DESTINATION include)
add_subdirectory (src)
option(IS_TESTING "Build for CTest" OFF)
if(IS_TESTING)
add_subdirectory (test)
endif()
bob_end_package()