]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | # Copyright 2018, 2019 Peter Dimov |
2 | # Distributed under the Boost Software License, Version 1.0. | |
3 | # See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt | |
4 | ||
5 | # Partial and experimental CMake support | |
6 | # Subject to change; please do not rely on the contents of this file yet | |
7 | ||
8 | cmake_minimum_required(VERSION 3.5...3.16) | |
9 | ||
10 | project(boost_timer VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) | |
11 | ||
12 | add_library(boost_timer | |
13 | src/auto_timers_construction.cpp | |
14 | src/cpu_timer.cpp | |
15 | ) | |
16 | ||
17 | add_library(Boost::timer ALIAS boost_timer) | |
18 | ||
19 | target_include_directories(boost_timer PUBLIC include) | |
20 | ||
21 | target_compile_definitions(boost_timer | |
22 | PUBLIC | |
23 | BOOST_TIMER_NO_LIB | |
24 | ) | |
25 | ||
26 | if(BUILD_SHARED_LIBS) | |
27 | target_compile_definitions(boost_timer PUBLIC BOOST_TIMER_DYN_LINK) | |
28 | else() | |
29 | target_compile_definitions(boost_timer PUBLIC BOOST_TIMER_STATIC_LINK) | |
30 | endif() | |
31 | ||
32 | target_link_libraries(boost_timer | |
33 | PUBLIC | |
34 | Boost::config | |
35 | Boost::core | |
36 | Boost::system | |
37 | PRIVATE | |
38 | Boost::chrono | |
39 | Boost::io | |
40 | Boost::predef | |
41 | Boost::throw_exception | |
42 | ) | |
43 | ||
44 | if(BUILD_TESTING) | |
45 | ||
46 | add_subdirectory(test) | |
47 | ||
48 | endif() |