diff --git a/CMakeLists.txt b/CMakeLists.txt
index 090539e..c05ba49 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,21 +2,12 @@ cmake_minimum_required(VERSION 3.5)
project(tinyxml2_vendor)
+find_package(ament_cmake REQUIRED)
list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
find_package(TinyXML2 REQUIRED)
-configure_file(tinyxml2_vendorConfig.cmake.in
-"${PROJECT_BINARY_DIR}/tinyxml2_vendorConfig.cmake" @ONLY)
-configure_file(tinyxml2_vendorConfig-version.cmake.in
-"${PROJECT_BINARY_DIR}/tinyxml2_vendorConfig-version.cmake" @ONLY)
-
install(DIRECTORY cmake DESTINATION share/${PROJECT_NAME})
-install(FILES
- package.xml
- DESTINATION share/${PROJECT_NAME})
-
-install(FILES
- "${PROJECT_BINARY_DIR}/tinyxml2_vendorConfig.cmake"
- "${PROJECT_BINARY_DIR}/tinyxml2_vendorConfig-version.cmake"
- DESTINATION share/${PROJECT_NAME}/cmake)
+ament_package(
+ CONFIG_EXTRAS "tinyxml2_vendor-extras.cmake"
+)
diff --git a/package.xml b/package.xml
index 4b678eb..cd85f73 100644
--- a/package.xml
+++ b/package.xml
@@ -12,11 +12,11 @@
William Woodall
Apache License 2.0
- cmake
+ ament_cmake
tinyxml2
- cmake
+ ament_cmake
diff --git a/tinyxml2_vendor-extras.cmake b/tinyxml2_vendor-extras.cmake
new file mode 100644
index 0000000..740e84f
--- /dev/null
+++ b/tinyxml2_vendor-extras.cmake
@@ -0,0 +1,15 @@
+# Copyright 2019 Open Source Robotics Foundation, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+list(INSERT CMAKE_MODULE_PATH 0 "${tinyxml2_vendor_DIR}/Modules")
diff --git a/tinyxml2_vendorConfig-version.cmake.in b/tinyxml2_vendorConfig-version.cmake.in
deleted file mode 100644
index 53f0fef..0000000
--- a/tinyxml2_vendorConfig-version.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-set(PACKAGE_VERSION @PACKAGE_VERSION@)
-
-set(PACKAGE_VERSION_EXACT False)
-set(PACKAGE_VERSION_COMPATIBLE False)
-
-if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}")
- set(PACKAGE_VERSION_EXACT True)
- set(PACKAGE_VERSION_COMPATIBLE True)
-endif()
-
-if("${PACKAGE_FIND_VERSION}" VERSION_LESS "${PACKAGE_VERSION}")
- set(PACKAGE_VERSION_COMPATIBLE True)
-endif()
diff --git a/tinyxml2_vendorConfig.cmake.in b/tinyxml2_vendorConfig.cmake.in
deleted file mode 100644
index ec9d543..0000000
--- a/tinyxml2_vendorConfig.cmake.in
+++ /dev/null
@@ -1,13 +0,0 @@
-# prevent multiple inclusion
-if(_@PROJECT_NAME@_CONFIG_INCLUDED)
- return()
-endif()
-set(_@PROJECT_NAME@_CONFIG_INCLUDED TRUE)
-
-# output package information
-if(NOT @PROJECT_NAME@_FIND_QUIETLY)
- message(STATUS "Found @PROJECT_NAME@: @PACKAGE_VERSION@ (${@PROJECT_NAME@_DIR})")
-endif()
-
-# add the local Modules directory to the modules path
-list(INSERT CMAKE_MODULE_PATH 0 "${@PROJECT_NAME@_DIR}/Modules")