Improvements to CMake buildsystem (#563)

* Move enable_testing() into proper place

* Added CMake's checks for C++11 standards

Raised minimal version of CMake to 3.1, since on old systems there no
decent compilers that supports c++11.

Closes #377.

* Externalize googletest project

Externalize gtest to avoid installation, fixes #539.

* Remove defined cmake_policies

CMP0012 - OLD marked as deprecated for >=cmake-3.1 and will be removed
CMP0015 - does not affect to build process
CMP0042 - already NEW for >=cmake-3.1

Fixes #505

* Fix compiling in Windows MSVC
This commit is contained in:
Azamat H. Hackimov
2018-08-09 15:11:50 +03:00
committed by Jesse Beder
parent 1698b47b65
commit 3e33bb3166
3 changed files with 49 additions and 44 deletions

View File

@@ -3,14 +3,12 @@ cmake_minimum_required(VERSION 3.5)
add_sources(parse.cpp)
add_executable(parse parse.cpp)
target_link_libraries(parse yaml-cpp)
set_target_properties(parse PROPERTIES COMPILE_FLAGS "-std=c++11")
add_sources(sandbox.cpp)
add_executable(sandbox sandbox.cpp)
target_link_libraries(sandbox yaml-cpp)
set_target_properties(sandbox PROPERTIES COMPILE_FLAGS "-std=c++11")
add_sources(read.cpp)
add_executable(read read.cpp)
target_link_libraries(read yaml-cpp)
set_target_properties(read PROPERTIES COMPILE_FLAGS "-std=c++11")