forked from jbeder/yaml-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Test the generated CMake package.
- Loading branch information
1 parent
f732014
commit 4f98623
Showing
3 changed files
with
68 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(yaml-cpp-consumer LANGUAGES CXX) | ||
|
||
find_package(yaml-cpp CONFIG REQUIRED) | ||
get_target_property(LIBRARY_TYPE yaml-cpp::yaml-cpp TYPE) | ||
|
||
if(LIBRARY_TYPE STREQUAL "SHARED_LIBRARY") | ||
if(NOT YAML_CPP_SHARED_LIBS_BUILT) | ||
message(FATAL_ERROR "Library type (${LIBRARY_TYPE}) contradicts config: ${YAML_CPP_SHARED_LIBS_BUILT}") | ||
endif() | ||
else() | ||
if(YAML_CPP_SHARED_LIBS_BUILT) | ||
message(FATAL_ERROR "Library type (${LIBRARY_TYPE}) contradicts config: ${YAML_CPP_SHARED_LIBS_BUILT}") | ||
endif() | ||
endif() | ||
|
||
add_executable(main main.cpp) | ||
set_target_properties(main PROPERTIES CXX_STANDARD 11) | ||
target_link_libraries(main PRIVATE ${YAML_CPP_LIBRARIES}) |
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,3 @@ | ||
#include "yaml-cpp/yaml.h" | ||
|
||
int main(int, char**) { YAML::Parser foo{}; } |