-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
173 lines (147 loc) · 5.99 KB
/
CMakeLists.txt
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
cmake_minimum_required(VERSION 3.22)
project(Libalgebra_lite)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/Modules)
#set(CMAKE_CXX_STANDARD 14)
#set(CMAKE_CXX_STANDARD_REQUIRED ON)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
include(GenerateExportHeader)
include(GNUInstallDirs)
option(LIBALGEBRA_LITE_BUILD_TESTS OFF "Build tests for libalgebra lite")
option(LIBALGEBRA_LITE_RATIONAL_COEFFS ON "Build with support for rational coefficients")
find_package(Boost REQUIRED)
add_library(Libalgebra_lite SHARED
src/algebra/lie_multiplier.cpp
src/algebra/polynomial_multiplier.cpp
src/algebra/polynomial.cpp
src/algebra/half_shuffle_multiplier.cpp
src/algebra/free_tensor_multiplier.cpp
src/algebra/shuffle_multiplier.cpp
src/algebra/polynomial_ring.cpp
src/basis/hall_set.cpp
src/basis/tensor_basis.cpp
src/basis/monomial.cpp
src/basis/polynomial_basis.cpp
src/basis/unpacked_tensor_word.cpp
src/coefficients/floating_fields.cpp
src/maps.cpp
include/libalgebra_lite/detail/integer_maths.h
include/libalgebra_lite/detail/macros.h
include/libalgebra_lite/detail/notnull.h
include/libalgebra_lite/detail/traits.h
include/libalgebra_lite/algebra.h
include/libalgebra_lite/basis.h
include/libalgebra_lite/basis_traits.h
include/libalgebra_lite/coefficients.h
include/libalgebra_lite/dense_vector.h
include/libalgebra_lite/free_tensor.h
include/libalgebra_lite/hall_set.h
include/libalgebra_lite/implementation_types.h
include/libalgebra_lite/index_key.h
include/libalgebra_lite/key_range.h
include/libalgebra_lite/lie.h
include/libalgebra_lite/maps.h
include/libalgebra_lite/operators.h
include/libalgebra_lite/packed_integer.h
include/libalgebra_lite/polynomial.h
include/libalgebra_lite/polynomial_basis.h
include/libalgebra_lite/registry.h
include/libalgebra_lite/shuffle_tensor.h
include/libalgebra_lite/sparse_vector.h
include/libalgebra_lite/tensor_basis.h
include/libalgebra_lite/unpacked_tensor_word.h
include/libalgebra_lite/vector.h
include/libalgebra_lite/vector_base.h
include/libalgebra_lite/vector_bundle.h
include/libalgebra_lite/vector_traits.h
)
add_library(Libalgebra_lite::Libalgebra_lite ALIAS Libalgebra_lite)
generate_export_header(Libalgebra_lite)
if (LIBALGEBRA_LITE_RATIONAL_COEFFS)
set(LAL_ENABLE_RATIONAL_COEFFS ON)
find_package(Bignum REQUIRED)
if (NOT TARGET Bignum::Bignum)
set(LAL_NO_USE_GMP ON)
else ()
target_link_libraries(Libalgebra_lite PUBLIC Bignum::Bignum)
set(LAL_NO_USE_GMP OFF)
endif ()
if (NOT DEFINED LAL_GMP_ALTERNATIVE_HEADER)
set(LAL_GMP_ALTERNATIVE_HEADER cpp_int.hpp)
set(LAL_GMP_ALTERNATIVE_TYPE cpp_rational)
endif ()
configure_file(cmake/rationals.h.in rationals.h NO_SOURCE_PERMISSIONS @ONLY)
target_sources(Libalgebra_lite PRIVATE src/coefficients/rational_field.cpp)
else()
set(LAL_ENABLE_RATIONAL_COEFFS OFF)
endif()
target_include_directories(Libalgebra_lite PRIVATE
${CMAKE_CURRENT_LIST_DIR}
${CMAKE_CURRENT_BINARY_DIR})
target_include_directories(Libalgebra_lite PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include/>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
target_link_libraries(Libalgebra_lite PUBLIC Boost::boost)
#if (TARGET Libalgebra::Libalgebra)
# set(LAL_USE_LIBALGEBRA ON)
# target_link_libraries(Libalgebra_lite PUBLIC Libalgebra::Libalgebra)
#endif ()
#set(CMAKE_MACOSX_RPATH ON)
if (NOT APPLE)
set_target_properties(Libalgebra_lite PROPERTIES
INSTALL_RPATH $ORIGIN)
endif ()
configure_file(cmake/config.h.in config.h NO_SOURCE_PERMISSIONS @ONLY)
install(TARGETS Libalgebra_lite
EXPORT Libalgebra_liteTargets
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libalgebra_lite"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
FRAMEWORK DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/libalgebra_lite
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT Development
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h
${CMAKE_CURRENT_BINARY_DIR}/libalgebra_lite_export.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libalgebra_lite
COMPONENT Development
)
if(LIBALGEBRA_LITE_RATIONAL_COEFFS)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rationals.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libalgebra_lite
COMPONENT Development
)
install(FILES "${CMAKE_CURRENT_LIST_DIR}/cmake/Modules/FindBignum.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Modules"
COMPONENT Development
)
endif()
install(EXPORT Libalgebra_liteTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Libalgebra_lite
NAMESPACE Libalgebra_lite::
COMPONENT Development
)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(Libalgebra_liteVersion.cmake
VERSION 1.0.0
COMPATIBILITY SameMajorVersion
)
set(cmakeModulesDir cmake)
configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/cmake/Libalgebra_liteConfig.cmake.in
Libalgebra_liteConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Libalgebra_lite
PATH_VARS cmakeModulesDir
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/Libalgebra_liteConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/Libalgebra_liteVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Libalgebra_lite
COMPONENT Development
)
if(CMAKE_IS_TOP_LEVEL OR LIBALGEBRA_LITE_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()