* CMake: Prefix options with "YAML" and hide platform-specific options
When including yaml-cpp as a subproject, some option names can conflict with other projects.
(1) Make sure the yaml-cpp options are prefixed with YAML
(2) Hide platform-specific options when possible to avoid cluttering the cmake option list
* Update docs for change from BUILD_SHARED_LIBS to YAML_BUILD_SHARED_LIBS
Setting CMAKE_CXX_STANDARD and CMAKE_CXX_STANDARD_REQUIRED directly is problematic when including yaml-cpp as a subproject.
The proper way is to set these per-target.
* Add compilation flags: -Wshadow -Weffc++ -pedantic -pedantic-errors
* Delete implicit copy & move constructors & assignment operators
in classes with pointer data members.
* An exception to the above: Add default copy & move constructors &
assignment operators for the Binary class.
* Convert boolean RegEx operators to binary operators.
* Initialize all members in all classes in ctors.
* Let default ctor delegate to the converting ctor in
Binary and RegEx
* Don't change any tests except regex_test (as a result of the change
to binary operators).
Note: https://bugzilla.redhat.com/show_bug.cgi?id=1544675 makes
-Weffc++ report a false positive in "include/yaml-cpp/node/impl.h".
NDK now uses ninja for building but yaml-cpp would emit the “ninja: error: build.ninja:326: bad $-escape (literal $ must be written as $$)” error due to syntax error in the generated build.ninja file. Related issue: https://github.com/jbeder/yaml-cpp/issues/630
Let CMake handle the default optimizations for various configurations. We don't need to override them. In fact, overriding them makes it impossible for users to override them themselves.
Roll-forward of c90c08ccc9 "Revert "Improvements to CMake buildsystem (#563)""
NEW:
* Replace CMAKE_SOURCE_DIR with CMAKE_CURRENT_SOURCE_DIR
Fixes#612 when yaml-cpp is used as a git submodule.
ORIGINAL:
* 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
* 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
It was incorrectly left at 0.6.0 when 0.6.1 was released, so this needs to be done to make it consistent between the tagged version and the CMake version.
Don't build tests if the confusingly named YAML_CPP_BUILD_TOOLS is ON.
Instead, add a new option that controls only if the tests are built.
(Also, default tests to OFF.)
Remove use of CMAKE_INSTALL_PREFIX when specifying install destinations.
It is preferred that install destinations are specified as relative
paths, not absolute paths. This is also needed to create relocatable
installs, and thus should fix#526.
Don't install LIBRARIES on Windows to `bin`; they belong in `lib`. (This
appears to have been done in a mistaken attempt to install the DLL's to
`bin`, which do need to be there, but RUNTIME DESTINATION already takes
care of this.)
CMake policy CMP0042 changes the default value of the MACOSX_RPATH target property to TRUE, therefore setting the directory portion of the install_name field of a shared library to be @rpath on OS X.
This adds yaml-cpp-config.cmake, yaml-cpp-config-version.cmake, and
yaml-cpp-targets.cmake to the cmake install. As a result, cmake's
find_package can easily find yaml-cpp for software that depends on
yaml-cpp.
Add code to install cmake files to $CMAKE_INSTALL_PREFIX/CMake on
Windows, which is the de-facto standard.
Closesjbeder/yaml-cpp#336jbeder/yaml-cpp#127
- Adds 'std=c++11' compiler flags
- Replaces boost::type_traits with std::type_traits
- Replaces boost::shared_ptr with std::shared_ptr
- Replaces std::auto_ptr with std::unique_ptr
- Replaces raw pointers with std::unique_ptr in ptr_vector, ptr_stack, and SettingChanges
- Replaces boost::noncopyable with deleted copy and assignment operators
- Replaces boost::next with std::next
- Replaces boost::enable_if with std::enable_if
- Replaces boost::is_convertible with std::is_convertible
- Replaces ptrdiff_t with std::ptrdiff_t
- Replaces boost::iterator_facade and boost::iterator_adaptor with std::iterator, borrowing the 'proxy reference' technique from boost
- Removes Boost dependency from CMakeLists
- Formats changed files using clang-format