-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2230 from DARMA-tasking/2175-add-yaml-as-input-as…
…-alternative #2175: Add YAML as input as alternative to command-line arguments
- Loading branch information
Showing
104 changed files
with
12,539 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
# 3.5 is actually available almost everywhere, but this a good minimum | ||
cmake_minimum_required(VERSION 3.4) | ||
|
||
# enable MSVC_RUNTIME_LIBRARY target property | ||
# see https://cmake.org/cmake/help/latest/policy/CMP0091.html | ||
if(POLICY CMP0091) | ||
cmake_policy(SET CMP0091 NEW) | ||
endif() | ||
|
||
project(YAML_CPP VERSION 0.7.0 LANGUAGES CXX) | ||
|
||
include(CMakePackageConfigHelpers) | ||
include(CMakeDependentOption) | ||
include(CheckCXXCompilerFlag) | ||
include(GNUInstallDirs) | ||
include(CTest) | ||
|
||
find_program(YAML_CPP_CLANG_FORMAT_EXE NAMES clang-format) | ||
|
||
option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" ON) | ||
option(YAML_CPP_BUILD_TOOLS "Enable parse tools" ON) | ||
option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ${BUILD_SHARED_LIBS}) | ||
|
||
cmake_dependent_option(YAML_CPP_BUILD_TESTS | ||
"Enable yaml-cpp tests" ON | ||
"BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF) | ||
cmake_dependent_option(YAML_MSVC_SHARED_RT | ||
"MSVC: Build yaml-cpp with shared runtime libs (/MD)" ON | ||
"MSVC" OFF) | ||
|
||
set(yaml-cpp-type STATIC) | ||
set(yaml-cpp-label-postfix "static") | ||
if (YAML_BUILD_SHARED_LIBS) | ||
set(yaml-cpp-type SHARED) | ||
set(yaml-cpp-label-postfix "shared") | ||
endif() | ||
|
||
set(build-shared $<BOOL:${YAML_BUILD_SHARED_LIBS}>) | ||
set(build-windows-dll $<AND:$<BOOL:${CMAKE_HOST_WIN32}>,${build-shared}>) | ||
set(not-msvc $<NOT:$<CXX_COMPILER_ID:MSVC>>) | ||
set(msvc-shared_rt $<BOOL:${YAML_MSVC_SHARED_RT}>) | ||
|
||
if (NOT DEFINED CMAKE_MSVC_RUNTIME_LIBRARY) | ||
set(CMAKE_MSVC_RUNTIME_LIBRARY | ||
MultiThreaded$<$<CONFIG:Debug>:Debug>$<${msvc-shared_rt}:DLL>) | ||
endif() | ||
|
||
set(contrib-pattern "src/contrib/*.cpp") | ||
set(src-pattern "src/*.cpp") | ||
if (CMAKE_VERSION VERSION_GREATER 3.12) | ||
list(INSERT contrib-pattern 0 CONFIGURE_DEPENDS) | ||
list(INSERT src-pattern 0 CONFIGURE_DEPENDS) | ||
endif() | ||
|
||
file(GLOB yaml-cpp-contrib-sources ${contrib-pattern}) | ||
file(GLOB yaml-cpp-sources ${src-pattern}) | ||
|
||
set(msvc-rt $<TARGET_PROPERTY:MSVC_RUNTIME_LIBRARY>) | ||
|
||
set(msvc-rt-mtd-static $<STREQUAL:${msvc-rt},MultiThreadedDebug>) | ||
set(msvc-rt-mt-static $<STREQUAL:${msvc-rt},MultiThreaded>) | ||
|
||
set(msvc-rt-mtd-dll $<STREQUAL:${msvc-rt},MultiThreadedDebugDLL>) | ||
set(msvc-rt-mt-dll $<STREQUAL:${msvc-rt},MultiThreadedDLL>) | ||
|
||
set(backport-msvc-runtime $<VERSION_LESS:${CMAKE_VERSION},3.15>) | ||
|
||
add_library(yaml-cpp ${yaml-cpp-type} "") | ||
add_library(yaml-cpp::yaml-cpp ALIAS yaml-cpp) | ||
|
||
set_property(TARGET yaml-cpp | ||
PROPERTY | ||
MSVC_RUNTIME_LIBRARY ${CMAKE_MSVC_RUNTIME_LIBRARY}) | ||
set_property(TARGET yaml-cpp | ||
PROPERTY | ||
CXX_STANDARD_REQUIRED ON) | ||
|
||
target_include_directories(yaml-cpp | ||
SYSTEM PUBLIC | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
PRIVATE | ||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>) | ||
|
||
if (NOT DEFINED CMAKE_CXX_STANDARD) | ||
set_target_properties(yaml-cpp | ||
PROPERTIES | ||
CXX_STANDARD 11) | ||
endif() | ||
|
||
target_compile_options(yaml-cpp | ||
PRIVATE | ||
$<${not-msvc}:-pedantic -pedantic-errors> | ||
|
||
$<$<AND:${backport-msvc-runtime},${msvc-rt-mtd-static}>:-MTd> | ||
$<$<AND:${backport-msvc-runtime},${msvc-rt-mt-static}>:-MT> | ||
$<$<AND:${backport-msvc-runtime},${msvc-rt-mtd-dll}>:-MDd> | ||
$<$<AND:${backport-msvc-runtime},${msvc-rt-mt-dll}>:-MD>) | ||
|
||
target_compile_definitions(yaml-cpp | ||
PRIVATE | ||
$<${build-windows-dll}:${PROJECT_NAME}_DLL> | ||
$<$<NOT:$<BOOL:${YAML_CPP_BUILD_CONTRIB}>>:YAML_CPP_NO_CONTRIB>) | ||
|
||
target_sources(yaml-cpp | ||
PRIVATE | ||
$<$<BOOL:${YAML_CPP_BUILD_CONTRIB}>:${yaml-cpp-contrib-sources}> | ||
${yaml-cpp-sources}) | ||
|
||
if (NOT DEFINED CMAKE_DEBUG_POSTFIX) | ||
set(CMAKE_DEBUG_POSTFIX "d") | ||
endif() | ||
|
||
set_target_properties(yaml-cpp PROPERTIES | ||
VERSION "${PROJECT_VERSION}" | ||
SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}" | ||
PROJECT_LABEL "yaml-cpp ${yaml-cpp-label-postfix}" | ||
DEBUG_POSTFIX "${CMAKE_DEBUG_POSTFIX}") | ||
|
||
configure_package_config_file( | ||
"${PROJECT_SOURCE_DIR}/yaml-cpp-config.cmake.in" | ||
"${PROJECT_BINARY_DIR}/yaml-cpp-config.cmake" | ||
INSTALL_DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/yaml-cpp") | ||
|
||
write_basic_package_version_file( | ||
"${PROJECT_BINARY_DIR}/yaml-cpp-config-version.cmake" | ||
COMPATIBILITY AnyNewerVersion) | ||
|
||
configure_file(yaml-cpp.pc.in yaml-cpp.pc @ONLY) | ||
|
||
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ | ||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
FILES_MATCHING PATTERN "*.h") | ||
|
||
if(YAML_CPP_BUILD_TESTS) | ||
add_subdirectory(test) | ||
endif() | ||
|
||
if(YAML_CPP_BUILD_TOOLS) | ||
add_subdirectory(util) | ||
endif() | ||
|
||
if (YAML_CPP_CLANG_FORMAT_EXE) | ||
add_custom_target(format | ||
COMMAND clang-format --style=file -i $<TARGET_PROPERTY:yaml-cpp,SOURCES> | ||
COMMAND_EXPAND_LISTS | ||
COMMENT "Running clang-format" | ||
VERBATIM) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2008-2015 Jesse Beder. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# yaml-cpp [![Build Status](https://travis-ci.org/jbeder/yaml-cpp.svg?branch=master)](https://travis-ci.org/jbeder/yaml-cpp) [![Documentation](https://codedocs.xyz/jbeder/yaml-cpp.svg)](https://codedocs.xyz/jbeder/yaml-cpp/) | ||
|
||
yaml-cpp is a [YAML](http://www.yaml.org/) parser and emitter in C++ matching the [YAML 1.2 spec](http://www.yaml.org/spec/1.2/spec.html). | ||
|
||
To get a feel for how it can be used, see the [Tutorial](https://github.com/jbeder/yaml-cpp/wiki/Tutorial) or [How to Emit YAML](https://github.com/jbeder/yaml-cpp/wiki/How-To-Emit-YAML). For the old API (version < 0.5.0), see [How To Parse A Document](https://github.com/jbeder/yaml-cpp/wiki/How-To-Parse-A-Document-(Old-API)). | ||
|
||
# Problems? # | ||
|
||
If you find a bug, post an [issue](https://github.com/jbeder/yaml-cpp/issues)! If you have questions about how to use yaml-cpp, please post it on http://stackoverflow.com and tag it [`yaml-cpp`](http://stackoverflow.com/questions/tagged/yaml-cpp). | ||
|
||
# How to Build # | ||
|
||
yaml-cpp uses [CMake](http://www.cmake.org) to support cross-platform building. The basic steps to build are: | ||
|
||
1. Download and install [CMake](http://www.cmake.org) (Resources -> Download). | ||
|
||
**Note:** If you don't use the provided installer for your platform, make sure that you add CMake's bin folder to your path. | ||
|
||
2. Navigate into the source directory, and type: | ||
|
||
``` | ||
mkdir build | ||
cd build | ||
``` | ||
|
||
3. Run CMake. The basic syntax is: | ||
|
||
``` | ||
cmake [-G generator] [-DYAML_BUILD_SHARED_LIBS=ON|OFF] .. | ||
``` | ||
|
||
* The `generator` is whatever type of build system you'd like to use. To see a full list of generators on your platform, just run `cmake` (with no arguments). For example: | ||
* On Windows, you might use "Visual Studio 12 2013" to generate a Visual Studio 2013 solution or "Visual Studio 14 2015 Win64" to generate a 64-bit Visual Studio 2015 solution. | ||
* On OS X, you might use "Xcode" to generate an Xcode project | ||
* On a UNIX-y system, simply omit the option to generate a makefile | ||
|
||
* yaml-cpp defaults to building a static library, but you may build a shared library by specifying `-DYAML_BUILD_SHARED_LIBS=ON`. | ||
|
||
* For more options on customizing the build, see the [CMakeLists.txt](https://github.com/jbeder/yaml-cpp/blob/master/CMakeLists.txt) file. | ||
|
||
4. Build it! | ||
|
||
5. To clean up, just remove the `build` directory. | ||
|
||
# Recent Release # | ||
|
||
[yaml-cpp 0.6.0](https://github.com/jbeder/yaml-cpp/releases/tag/yaml-cpp-0.6.0) has been released! This release requires C++11, and no longer depends on Boost. | ||
|
||
[yaml-cpp 0.3.0](https://github.com/jbeder/yaml-cpp/releases/tag/release-0.3.0) is still available if you want the old API. | ||
|
||
**The old API will continue to be supported, and will still receive bugfixes!** The 0.3.x and 0.4.x versions will be old API releases, and 0.5.x and above will all be new API releases. | ||
|
||
# API Documentation | ||
|
||
The autogenerated API reference is hosted on [CodeDocs](https://codedocs.xyz/jbeder/yaml-cpp/index.html) | ||
|
||
# Third Party Integrations | ||
|
||
The following projects are not officially supported: | ||
|
||
- [Qt wrapper](https://gist.github.com/brcha/d392b2fe5f1e427cc8a6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
#define ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 | ||
|
||
#if defined(_MSC_VER) || \ | ||
(defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ | ||
(__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 | ||
#pragma once | ||
#endif | ||
|
||
#include <cstddef> | ||
|
||
namespace YAML { | ||
using anchor_t = std::size_t; | ||
const anchor_t NullAnchor = 0; | ||
} | ||
|
||
#endif // ANCHOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 |
Oops, something went wrong.