[tinyxml] added tinyxml cmake config file (#5544)

Adds ability to use
* find_package(TinyXML REQUIRED)
* TinyXML_LIBRARIES
* tinyxml_INCLUDE_DIRS
This commit is contained in:
markdegreef 2019-03-05 19:39:01 +01:00 committed by Phil Christensen
parent 40a8969d6d
commit 6b4b62ad97
2 changed files with 20 additions and 0 deletions

View File

@ -28,3 +28,4 @@ vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/tinyxml RENAME copyright)
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/tinyxml-config.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/tinyxml)

View File

@ -0,0 +1,19 @@
if (tinyxml_CONFIG_INCLUDED)
return()
endif()
set(tinyxml_CONFIG_INCLUDED TRUE)
set(tinyxml_INCLUDE_DIRS "${CMAKE_CURRENT_LIST_DIR}/../../include")
foreach(lib tinyxml)
set(onelib "${lib}-NOTFOUND")
find_library(onelib ${lib}
PATHS "${CMAKE_CURRENT_LIST_DIR}/../../lib"
NO_DEFAULT_PATH
)
if(NOT onelib)
message(FATAL_ERROR "Library '${lib}' in package tinyxml is not installed properly")
endif()
list(APPEND tinyxml_LIBRARIES ${onelib})
endforeach()