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 8cmake_minimum_required(VERSION 3.5...3.16) 9 10project(boost_timer VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX) 11 12add_library(boost_timer 13 src/auto_timers_construction.cpp 14 src/cpu_timer.cpp 15) 16 17add_library(Boost::timer ALIAS boost_timer) 18 19target_include_directories(boost_timer PUBLIC include) 20 21target_compile_definitions(boost_timer 22 PUBLIC 23 BOOST_TIMER_NO_LIB 24) 25 26if(BUILD_SHARED_LIBS) 27 target_compile_definitions(boost_timer PUBLIC BOOST_TIMER_DYN_LINK) 28else() 29 target_compile_definitions(boost_timer PUBLIC BOOST_TIMER_STATIC_LINK) 30endif() 31 32target_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 44if(BUILD_TESTING) 45 46 add_subdirectory(test) 47 48endif() 49