More cmake enhancements#95
Merged
Merged
Conversation
Fix syntax of the version check: previously, we searched for any version of libxml-2.0 and then, if not found, for ">=" and "2.4.28" modules (!). Remove spaces to do what we really need to do. Also use pkg_check_modules() rather than pkg_search_module() because the latter is meant for searching for multiple modules, but here we know which module we need, so use the simpler command instead.
There was a typo changing the meaning of the comment there.
Setting CMAKE_CXX_COMPILER_VISIBILITY_PRESET didn't work (any more?), so do it properly, by setting per-target options. Also define the necessary symbols, i.e. DLL_EXPORT when building the libraries and XMLWRAPP_USE_DLL or XSLTWRAPP_USE_DLL when using them.
This makes the binary relocatable. Rename use_hidden_visibility() function to setup_shared_library() as it now does more than just sets up the hidden visibility.
As this is something that only needs to be done for shared libraries (and always needs to be done for them), do it in the same function that is already used for setting visibility and runpath options.
Allow customizing the shared libraries names. This is useful to avoid conflicts with the other libraries that may be present on the system.
Add missing XMLWRAPP_API to the functions declarations.
05552b0 to
8458396
Compare
Don't give the same message every time CMake is rerun, this is more annoying than useful.
The library is expected to define these targets too by convention, so do it.
43fe371 to
ad98434
Compare
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.
No description provided.