Fix paths in pkg-config file#556
Merged
Merged
Conversation
pkg-config should be giving absolute paths rather than relative paths.
Owner
|
Is there a way to automatically test stuff like this? It would be nice to avoid having these CMake changes breaking things. |
Contributor
Author
|
Something like: make install
mkdir /tmp/hello_world
cd /tmp/hello_world
cat << 'EOF' > hello_world.cpp
#include <yaml-cpp/yaml.h>
int main() {
YAML::Node node = YAML::Node("Hello, World!");
return 0;
}
EOF
$CXX hello_world.cpp -Wall -std=c++11 $(pkg-config --cflags yaml-cpp) $(pkg-config --libs yaml-cpp) -o hello_world_pkg_config
./hello_world_pkg_configThough possibly that would still compile (with a warning from To test make install
mkdir /tmp/hello_world
cd /tmp/hello_world
cat << 'EOF' > hello_world.cpp
#include <yaml-cpp/yaml.h>
int main() {
YAML::Node node = YAML::Node("Hello, World!");
return 0;
}
EOF
cat << 'EOF' > CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(hello_world)
find_package(yaml-cpp REQUIRED)
add_executable(hello_world_cmake hello_world.cpp)
target_link_libraries(hello_world_cmake yaml-cpp)
EOF
cmake .
make
./hello_world_cmake |
Owner
|
I mean automatically; how do I write that test? |
Contributor
Author
|
The quick way would be paste the above into a file script:
- make
- test/run-tests
- make install
- ./my_bash_script |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pkg-configshould be giving absolute paths rather than relative paths.Broken by dc9c750 and in 0.6.0. If it would be possible to cut a 0.6.1 release with this fix in it, it would be very much appreciated.
Before:
After (for example with install prefix
/usr/local):PTAL @jbeder.