diff --git a/rmw_implementation/CMakeLists.txt b/rmw_implementation/CMakeLists.txt
index 58b685cd0..577b8a57b 100644
--- a/rmw_implementation/CMakeLists.txt
+++ b/rmw_implementation/CMakeLists.txt
@@ -1,14 +1,18 @@
cmake_minimum_required(VERSION 2.8.3)
-project(rmw_implementation NONE)
+# must be not NONE since some rmw implementation require compiler checks
+project(rmw_implementation)
find_package(ament_cmake REQUIRED)
+find_package(rmw_implementation_cmake REQUIRED)
if(AMENT_ENABLE_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()
+get_default_rmw_implementation(RMW_IMPLEMENTATION)
+
ament_package(
- CONFIG_EXTRAS "rmw_implementation-extras.cmake"
+ CONFIG_EXTRAS "rmw_implementation-extras.cmake.in"
)
diff --git a/rmw_implementation/package.xml b/rmw_implementation/package.xml
index 1ef50ebb8..9e45646e2 100644
--- a/rmw_implementation/package.xml
+++ b/rmw_implementation/package.xml
@@ -7,13 +7,13 @@
Apache License 2.0
ament_cmake
- ament_cmake
- rmw_connext_cpp
- rmw_connext_dynamic_cpp
- rmw_fastrtps_cpp
- rmw_implementation_cmake
- rmw_opensplice_cpp
+ rmw_implementation_cmake
+
+ rmw_connext_cpp
+ rmw_connext_dynamic_cpp
+ rmw_fastrtps_cpp
+ rmw_opensplice_cpp
ament_lint_auto
ament_lint_common
diff --git a/rmw_implementation/rmw_implementation-extras.cmake b/rmw_implementation/rmw_implementation-extras.cmake.in
similarity index 57%
rename from rmw_implementation/rmw_implementation-extras.cmake
rename to rmw_implementation/rmw_implementation-extras.cmake.in
index 9535fce07..00cb33b40 100644
--- a/rmw_implementation/rmw_implementation-extras.cmake
+++ b/rmw_implementation/rmw_implementation-extras.cmake.in
@@ -12,14 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# copied from rmw_implementation/rmw_implementation-extras.cmake
+# generated from rmw_implementation/rmw_implementation-extras.cmake.in
-find_package(rmw_implementation_cmake REQUIRED)
+set(RMW_IMPLEMENTATION "@RMW_IMPLEMENTATION@")
-get_default_rmw_implementation(_middleware_implementation)
-find_package("${_middleware_implementation}" REQUIRED)
+message(STATUS "Using RMW implementation: ${RMW_IMPLEMENTATION}")
+
+find_package("${RMW_IMPLEMENTATION}" REQUIRED)
# TODO should never need definitions and include dirs?
-list(APPEND rmw_implementation_DEFINITIONS ${${_middleware_implementation}_DEFINITIONS})
-list(APPEND rmw_implementation_INCLUDE_DIRS ${${_middleware_implementation}_INCLUDE_DIRS})
-list(APPEND rmw_implementation_LIBRARIES ${${_middleware_implementation}_LIBRARIES})
+list(APPEND rmw_implementation_DEFINITIONS ${${RMW_IMPLEMENTATION}_DEFINITIONS})
+list(APPEND rmw_implementation_INCLUDE_DIRS ${${RMW_IMPLEMENTATION}_INCLUDE_DIRS})
+list(APPEND rmw_implementation_LIBRARIES ${${RMW_IMPLEMENTATION}_LIBRARIES})