-
Notifications
You must be signed in to change notification settings - Fork 132
/
hoomd-config.cmake.in
93 lines (74 loc) · 3.47 KB
/
hoomd-config.cmake.in
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
########################################################
# HOOMD CMake configuration for externally built plugins
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
# build options
set(HOOMD_SHORTREAL_SIZE "@HOOMD_SHORTREAL_SIZE@")
set(HOOMD_LONGREAL_SIZE "@HOOMD_LONGREAL_SIZE@")
set(HOOMD_GPU_PLATFORM "@HOOMD_GPU_PLATFORM@")
set(BUILD_MD "@BUILD_MD@")
set(BUILD_HPMC "@BUILD_HPMC@")
set(BUILD_METAL "@BUILD_METAL@")
set(BUILD_DEM "@BUILD_DEM@")
set(BUILD_MPCD "@BUILD_MPCD@")
set(ENABLE_HIP "@ENABLE_HIP@")
set(HIP_PLATFORM "@HIP_PLATFORM@")
set(ENABLE_NVTOOLS "@ENABLE_NVTOOLS@")
set(ENABLE_ROCTRACER "@ENABLE_ROCTRACER@")
set(ENABLE_MPI "@ENABLE_MPI@")
set(ENABLE_TBB "@ENABLE_TBB@")
set(ENABLE_LLVM "@ENABLE_LLVM@")
set(ALWAYS_USE_MANAGED_MEMORY "@ALWAYS_USE_MANAGED_MEMORY@")
# CUDA architectures
set(CMAKE_CUDA_ARCHITECTURES "@CMAKE_CUDA_ARCHITECTURES@")
# C++ standard
set(CMAKE_CXX_STANDARD "@CMAKE_CXX_STANDARD@")
set(CMAKE_CUDA_STANDARD "@CMAKE_CUDA_STANDARD@")
# installation locations
set(HOOMD_INSTALL_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
set(PYTHON_SITE_INSTALL_DIR "@PYTHON_SITE_INSTALL_DIR@")
# configure python
set(Python_FIND_UNVERSIONED_NAMES "FIRST")
find_package(Python REQUIRED COMPONENTS Interpreter Development)
find_package(pybind11 2.12 CONFIG REQUIRED)
find_package_message(pybind11 "Found pybind11: ${pybind11_DIR} ${pybind11_INCLUDE_DIR} (version ${pybind11_VERSION})" "[${pybind11_DIR}][${pybind11_INCLUDE_DIR}]")
find_package(Eigen3 3.2 CONFIG REQUIRED)
find_package_message(EIGEN3 "Found eigen: ${Eigen3_DIR} ${EIGEN3_INCLUDE_DIR} (version ${Eigen3_VERSION})" "[${Eigen3_DIR}][${EIGEN3_INCLUDE_DIR}]")
# find optional dependencies
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
if (ENABLE_HIP)
include(HOOMDHIPSetup)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} @CMAKE_CUDA_FLAGS@")
endif()
if (ENABLE_MPI)
find_dependency(MPI REQUIRED)
find_package(cereal CONFIG)
if (cereal_FOUND)
find_package_message(cereal "Found cereal: ${cereal_DIR}" "[${cereal_DIR}]")
if (NOT TARGET cereal::cereal AND TARGET cereal)
message(STATUS "Found cereal target, adding cereal::cereal alias.")
add_library(cereal::cereal ALIAS cereal)
endif()
else()
# work around missing ceralConfig.cmake (common on Ubuntu 20.04)
find_path(cereal_INCLUDE_DIR NAMES cereal/cereal.hpp
PATHS ${CMAKE_INSTALL_PREFIX}/include)
add_library(cereal::cereal INTERFACE IMPORTED)
set_target_properties(cereal::cereal PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${cereal_INCLUDE_DIR}")
find_package_message(cereal "Could not find cereal by config file, falling back to ${cereal_INCLUDE_DIR}" "[${cereal_INCLUDE_DIR}]")
endif()
# Work around broken cereal::cereal target (common on Ubuntu 22.04)
get_target_property(_cereal_include cereal::cereal INTERFACE_INCLUDE_DIRECTORIES)
if (_cereal_include STREQUAL "/include")
find_path(cereal_INCLUDE_DIR NAMES cereal/cereal.hpp
PATHS ${CMAKE_INSTALL_PREFIX}/include)
set_target_properties(cereal::cereal PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${cereal_INCLUDE_DIR}")
find_package_message(cereal "Fixing broken cereal::cereal target with ${cereal_INCLUDE_DIR}" "[${cereal_INCLUDE_DIR}]")
endif()
endif()
if (ENABLE_TBB)
find_dependency(TBB 4.3 REQUIRED)
endif()
include("${CMAKE_CURRENT_LIST_DIR}/hoomd-targets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/hoomd-macros.cmake")
check_required_components(HOOMD)