-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve issue #526 #557
Resolve issue #526 #557
Conversation
endif() | ||
|
||
# export targets for find_package config mode | ||
export(TARGETS tinyxml2 | ||
FILE ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}Targets.cmake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand, the Export installation path should be LIBDIR/cmake/PROJECT_NAME
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@comargo which I did in line 166~171. This line just export the targets locally and not installing yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Sorry... I missed the name of variable...
@leethomason Could you merge this and make a release? This feature is necessary for integration to vcpkg. Thanks |
@leethomason Could you make a release? I will submit a pull request to vcpkg once you make a release, thanks! |
There's another PR going in, and then I'll do a release. |
@leethomason Thanks for the release. I submitted a PR to vcpkg and once it's merged Windows users will be able to build and install tinyxml2 by simply typing |
With this addition of cmake export, users can now use find_package(tinyxml2) in config mode, meaning no more Findtinyxml2.cmake is needed!!
To demonstrate the convenience of this feature, first clone, build, and install tinyxml2
Now go to your own repo and then create a CMakeLists of your own that looks something like
That will just work! A step by step to reproduce this will be something like