diff --git a/ports/tinyxml/portfile.cmake b/ports/tinyxml/portfile.cmake index 1d4e6131b6..2936a4d57c 100644 --- a/ports/tinyxml/portfile.cmake +++ b/ports/tinyxml/portfile.cmake @@ -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) diff --git a/ports/tinyxml/tinyxml-config.cmake b/ports/tinyxml/tinyxml-config.cmake new file mode 100644 index 0000000000..1bdc5ad7f3 --- /dev/null +++ b/ports/tinyxml/tinyxml-config.cmake @@ -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() +