Comments (3)
The advantage of creating the ALIAS
library is if you ever need to use it more than one place in your build system, you only have to have the conditional in one place.
from yaml-cpp.
Well, I haven't tried it with yaml-cpp, but I have had to deal with this problem before. Here's a snippet from that:
find_package(date CONFIG NAMES date howardhinnant-date REQUIRED)
message(STATUS "Found and using libdate.")
if(TARGET howardhinnant-date::howardhinnant-date-tz)
add_library(date::date-tz ALIAS howardhinnant-date::howardhinnant-date-tz)
endif()
I imagine you can use something similar.
from yaml-cpp.
Thanks :)
We ended up using a similar approach:
if (TARGET yaml-cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE yaml-cpp::yaml-cpp)
endif()
This should probably documented somewhere.
from yaml-cpp.
Related Issues (20)
- Numbers are emitted wrongly under non-C locales. HOT 2
- Problems with absend symbols in static library on Windows HOT 5
- Add example of emitting tags to documentation. HOT 2
- `YAML::Literal` does not work for `YAML::Binary` HOT 5
- How to import yaml-cpp to my project using yaml-cpp-config.cmake? HOT 1
- Floating-point numbers are uglified, a.k.a. write shortest floating-point representation with round-trip guarantee HOT 21
- Empty strings are silently replaced with 'null' now HOT 5
- Is the key of a node can be modified? HOT 1
- Parsing Binary value in Literal syntax resulting in extra newline character being added. HOT 2
- Example from tutorial crashes HOT 2
- .a works on many facility but error when compile on one of arm HOT 1
- seems yaml-cpp conan package does not support build_type=RelWithDebInfo properly.
- issue
- Compiler warnings can't be disabled when using FetchContent HOT 1
- CMake warning when using FetchContent
- How to push_back a map-node rather than a quote?
- Newest commit breaks build HOT 2
- yaml-cpp-0.8.0 fails due to missing missing include <cstdint> with gcc-5.0.0_pre20240804 snapshot HOT 1
- Carriage return is not considered as a line break character HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yaml-cpp.