diff --git a/CMakeLists.txt b/CMakeLists.txt index a01208e..54dcadd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,20 +60,20 @@ if(NOT (CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache") AND NOT (CMAKE_C_COMPILER_ endif(ccache_EXECUTABLE) endif() -macro(use_cxx11 target) +macro(use_cxx14 target) if(CMAKE_VERSION VERSION_LESS "3.1") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_compile_options(${target} PRIVATE "-std=gnu++11") + target_compile_options(${target} PRIVATE "-std=gnu++14") else() - target_compile_options(${target} PRIVATE "-std=c++11") + target_compile_options(${target} PRIVATE "-std=c++14") endif() else() set_target_properties(${target} PROPERTIES - CXX_STANDARD 11 + CXX_STANDARD 14 CXX_STANDARD_REQUIRED ON ) endif() -endmacro(use_cxx11) +endmacro(use_cxx14) find_package(Boost REQUIRED COMPONENTS system thread random) if(APPLE) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2235c6c..cc23a24 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,13 +18,13 @@ file(GLOB_RECURSE CPP_CLIENT_CORE_SRC ) add_library(etcd-cpp-api-core-objects OBJECT ${CPP_CLIENT_CORE_SRC} ${PROTOBUF_GENERATES}) -use_cxx11(etcd-cpp-api-core-objects) +use_cxx14(etcd-cpp-api-core-objects) add_dependencies(etcd-cpp-api-core-objects protobuf_generates) include_generated_protobuf_files(etcd-cpp-api-core-objects) # add the core library, includes the sycnhronous client only add_library(etcd-cpp-api-core $) -use_cxx11(etcd-cpp-api-core) +use_cxx14(etcd-cpp-api-core) target_link_libraries(etcd-cpp-api-core PUBLIC ${Boost_LIBRARIES} ${PROTOBUF_LIBRARIES} @@ -36,7 +36,7 @@ include_generated_protobuf_files(etcd-cpp-api-core) # add the client with asynchronus client add_library(etcd-cpp-api $ "${CMAKE_CURRENT_SOURCE_DIR}/Client.cpp") -use_cxx11(etcd-cpp-api) +use_cxx14(etcd-cpp-api) target_link_libraries(etcd-cpp-api PUBLIC ${Boost_LIBRARIES} ${CPPREST_LIB} # n.b.: the asynchronous client requires pplx in cpprestsdk @@ -56,4 +56,3 @@ else() install(TARGETS etcd-cpp-api-core etcd-cpp-api EXPORT etcd-targets) endif() - diff --git a/tst/CMakeLists.txt b/tst/CMakeLists.txt index 6770b5a..72238a5 100644 --- a/tst/CMakeLists.txt +++ b/tst/CMakeLists.txt @@ -18,7 +18,7 @@ foreach(testfile ${TEST_FILES}) else() add_executable(${test_name} EXCLUDE_FROM_ALL ${CMAKE_CURRENT_SOURCE_DIR}/${testfile}) endif() - use_cxx11(${test_name}) + use_cxx14(${test_name}) add_test(NAME ${test_name} COMMAND $) target_include_directories(${test_name} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../proto/gen)