File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This file lets you quickly build projects with the exact same boost-histogram
2
+ # settings that the Python bindings use.
3
+
4
+ cmake_minimum_required (VERSION 3.14...3.20)
5
+
6
+ project (BOOST_HISTOGRAM_CPP LANGUAGES CXX)
7
+
8
+
9
+ add_library (boost_histogram_cpp IMPORTED INTERFACE )
10
+
11
+ # these are the boost header-only libraries required by boost::histogram
12
+ target_include_directories (
13
+ boost_histogram_cpp
14
+ INTERFACE ../../extern/assert/include
15
+ ../../extern/config/include
16
+ ../../extern/core/include
17
+ ../../extern/histogram/include
18
+ ../../extern/mp11/include
19
+ ../../extern/throw_exception/include
20
+ ../../extern/variant2/include )
21
+
22
+
23
+ target_compile_options (boost_histogram_cpp
24
+ INTERFACE $<IF:$<CXX_COMPILER_ID:MSVC >,/fp:fast,-funsafe-math-optimizations>)
25
+
26
+ target_compile_features (boost_histogram_cpp INTERFACE cxx_std_14)
27
+
28
+ if (PROJECT_NAME STREQUAL CMAKE_PROJECT_NAME )
29
+ add_executable (simple simple.cpp)
30
+ target_link_libraries (simple PRIVATE boost_histogram_cpp)
31
+ endif ()
Original file line number Diff line number Diff line change
1
+ #include < boost/histogram.hpp>
2
+ #include < iostream>
3
+
4
+ int main () {
5
+ namespace bh = boost::histogram;
6
+
7
+ auto h = bh::make_histogram (bh::axis::category<int >{});
8
+
9
+ std::cout << bh::algorithm::sum (h) << std::endl;
10
+ }
11
+
You can’t perform that action at this time.
0 commit comments