-
Notifications
You must be signed in to change notification settings - Fork 146
Upgrade from tinyxml to tinyxml2 #186
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
Merged
+377
−366
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9fd9cf6
upgrade from tinyxml to tinyxml2
felixf4xu 06a18de
More cleanups.
clalancette 2f45917
Remove 'using tinyxml2'
clalancette f2a2ce5
Update github actions.
clalancette 2383a0a
Add in FindTinyXML2 for systems that don't have it.
clalancette a68d9a8
Make sure that tinyxml2::tinyxml2 is available in downstream packages
traversaro bef2860
Update urdfdom-config.cmake.in
traversaro a448c63
Replace InsertNewChildElement with GetDocument()->NewElement.
clalancette 713e457
Remove another use of using tinyxml2.
clalancette 2c58e3f
Merge remote-tracking branch 'traversaro/patch-3' into tinyxml2
clalancette b592bbd
Fix generation of CMake config files.
clalancette 0e61d1f
Install the FindTinyXML2.cmake file.
clalancette 23ea44e
Backup and restore the CMAKE_MODULE_PATH.
clalancette File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| # TinyXML2_FOUND | ||
| # TinyXML2_INCLUDE_DIRS | ||
| # TinyXML2_LIBRARIES | ||
|
|
||
| # try to find the CMake config file for TinyXML2 first | ||
| if(NOT TinyXML2_FOUND) | ||
| find_package(TinyXML2 CONFIG QUIET) | ||
| endif() | ||
| if(TinyXML2_FOUND) | ||
| message(STATUS "Found TinyXML2 via Config file: ${TinyXML2_DIR}") | ||
| if(NOT TINYXML2_LIBRARY) | ||
| # in this case, we're probably using TinyXML2 version 5.0.0 or greater | ||
| # in which case tinyxml2 is an exported target and we should use that | ||
| if(TARGET tinyxml2) | ||
| set(TINYXML2_LIBRARY tinyxml2) | ||
| elseif(TARGET tinyxml2::tinyxml2) | ||
| set(TINYXML2_LIBRARY tinyxml2::tinyxml2) | ||
| elseif(TinyXML2_FIND_REQUIRED) | ||
| message(FATAL_ERROR "Unable to determine target for TinyXML2") | ||
| endif() | ||
| list(APPEND TinyXML2_TARGETS ${TINYXML2_LIBRARY}) | ||
| else() | ||
| # Only perform that logic once | ||
| if(NOT TARGET tinyxml2::tinyxml2) | ||
| # TINYXML2_LIBRARY is composed of debug;<path\to\debug.lib>;optimized;<path\to\release.lib> | ||
| # we have to extract the appropriate component based on the current configuration. | ||
| list(LENGTH TINYXML2_LIBRARY TINYXML_LIBRARY_LIST_LENGTH) | ||
| if(NOT ${TINYXML_LIBRARY_LIST_LENGTH} EQUAL 4) | ||
| message(FATAL_ERROR "Unable to extract the library file path from ${TINYXML2_LIBRARY}") | ||
| endif() | ||
| if(CMAKE_BUILD_TYPE MATCHES DEBUG) | ||
| list(GET TINYXML2_LIBRARY 0 ASSERT_DEBUG) | ||
| if(NOT ${ASSERT_DEBUG} STREQUAL "debug") | ||
| message(FATAL_ERROR "could not parse debug library path from ${TINYXML2_LIBRARY}") | ||
| endif() | ||
| list(GET TINYXML2_LIBRARY 1 TINYXML2_LIBRARY_PATH) | ||
| else() | ||
| list(GET TINYXML2_LIBRARY 2 ASSERT_OPTIMIZED) | ||
| if(NOT ${ASSERT_OPTIMIZED} STREQUAL "optimized") | ||
| message(FATAL_ERROR "could not parse library path from ${TINYXML2_LIBRARY}") | ||
| endif() | ||
| list(GET TINYXML2_LIBRARY 3 TINYXML2_LIBRARY_PATH) | ||
| endif() | ||
| if(NOT EXISTS ${TINYXML2_LIBRARY_PATH}) | ||
| message(FATAL_ERROR "library file path ${TINYXML2_LIBRARY_PATH} does not exist") | ||
| endif() | ||
|
|
||
| add_library(tinyxml2::tinyxml2 UNKNOWN IMPORTED) | ||
| set_property(TARGET tinyxml2::tinyxml2 PROPERTY IMPORTED_LOCATION ${TINYXML2_LIBRARY_PATH}) | ||
| set_property(TARGET tinyxml2::tinyxml2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${TINYXML2_INCLUDE_DIR}) | ||
| list(APPEND TinyXML2_TARGETS tinyxml2::tinyxml2) | ||
| endif() | ||
| endif() | ||
| else() | ||
| find_path(TINYXML2_INCLUDE_DIR NAMES tinyxml2.h) | ||
|
|
||
| find_library(TINYXML2_LIBRARY tinyxml2) | ||
|
|
||
| include(FindPackageHandleStandardArgs) | ||
| find_package_handle_standard_args(TinyXML2 DEFAULT_MSG TINYXML2_LIBRARY TINYXML2_INCLUDE_DIR) | ||
|
|
||
| mark_as_advanced(TINYXML2_INCLUDE_DIR TINYXML2_LIBRARY) | ||
|
|
||
| if(NOT TARGET tinyxml2::tinyxml2) | ||
| add_library(tinyxml2::tinyxml2 UNKNOWN IMPORTED) | ||
| set_property(TARGET tinyxml2::tinyxml2 PROPERTY IMPORTED_LOCATION ${TINYXML2_LIBRARY}) | ||
| set_property(TARGET tinyxml2::tinyxml2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${TINYXML2_INCLUDE_DIR}) | ||
| list(APPEND TinyXML2_TARGETS tinyxml2::tinyxml2) | ||
| endif() | ||
| endif() | ||
|
|
||
| # Set mixed case INCLUDE_DIRS and LIBRARY variables from upper case ones. | ||
| if(NOT TinyXML2_INCLUDE_DIRS) | ||
| set(TinyXML2_INCLUDE_DIRS ${TINYXML2_INCLUDE_DIR}) | ||
| endif() | ||
| if(NOT TinyXML2_LIBRARIES) | ||
| set(TinyXML2_LIBRARIES ${TINYXML2_LIBRARY}) | ||
| endif() |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.