From 5445ce90683fe4727364ac646b8bc900f4f16114 Mon Sep 17 00:00:00 2001 From: Adam Rehn Date: Sun, 8 Jul 2018 16:23:49 +1000 Subject: [PATCH] Add Conan support --- .gitignore | 3 +++ CMakeLists.txt | 10 ++++++++-- conanfile.txt | 8 ++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 conanfile.txt diff --git a/.gitignore b/.gitignore index 722d5e7..7e520f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ +conanbuildinfo.cmake +conanbuildinfo.txt +conaninfo.txt .vscode diff --git a/CMakeLists.txt b/CMakeLists.txt index c4da380..d484413 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,13 +6,19 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) -# Enable all compiler warnings +# Enable all relevant compiler warnings if (MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MD") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W2 /MD") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") endif() +# If we are using the Conan CMake generator, include the generated file +if(EXISTS "${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake") + include("${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake") + conan_basic_setup() +endif() + # Locate the Boost headers find_package(Boost 1.64 REQUIRED) include_directories(${Boost_INCLUDE_DIRS} SYSTEM) diff --git a/conanfile.txt b/conanfile.txt new file mode 100644 index 0000000..ac10efe --- /dev/null +++ b/conanfile.txt @@ -0,0 +1,8 @@ +[requires] +boost/1.67.0@conan/stable + +[generators] +cmake + +[options] +boost:header_only=True