diff --git a/README.md b/README.md index cf30c69..d6ed86a 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,17 @@ CPMAddPackage( ) ``` + +### [Boost (via boost-cmake)](https://github.com/Orphis/boost-cmake) + +```CMake +CPMAddPackage( + NAME boost-cmake + GITHUB_REPOSITORY Orphis/boost-cmake + VERSION 1.67.0 +) +``` + ### [google/benchmark](https://github.com/google/benchmark) ```cmake diff --git a/examples/boost/CMakeLists.txt b/examples/boost/CMakeLists.txt new file mode 100644 index 0000000..cfa59ee --- /dev/null +++ b/examples/boost/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.14 FATAL_ERROR) + +# ---- Create binary ---- + +add_executable(CPMExampleBoost main.cpp) +set_target_properties(CPMExampleBoost PROPERTIES CXX_STANDARD 17) + +# ---- Dependencies ---- + +include(../../cmake/CPM.cmake) + +CPMAddPackage( + NAME boost + GITHUB_REPOSITORY Orphis/boost-cmake + VERSION 1.67.0 +) + +target_link_libraries(CPMExampleBoost PRIVATE Boost::system pthread) diff --git a/examples/boost/main.cpp b/examples/boost/main.cpp new file mode 100644 index 0000000..720856f --- /dev/null +++ b/examples/boost/main.cpp @@ -0,0 +1,30 @@ +// +// timer.cpp +// ~~~~~~~~~ +// +// Copyright (c) 2003-2016 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// + +#include +#include +#include + +void print(const boost::system::error_code& /*e*/) +{ + std::cout << "Hello, world!" << std::endl; +} + +int main() +{ + boost::asio::io_service io; + + boost::asio::deadline_timer t(io, boost::posix_time::seconds(1)); + t.async_wait(&print); + + io.run(); + + return 0; +} \ No newline at end of file diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 1fe13e9..a1290d4 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,5 +10,4 @@ foreach(test ${tests}) NAME ${test} COMMAND ${CMAKE_COMMAND} -DCPM_PATH=${CMAKE_CURRENT_SOURCE_DIR}/../cmake -P "${test}" ) - endforeach()