Skip to content

Commit

Permalink
Use target_compile_features for c++14 default standard
Browse files Browse the repository at this point in the history
Suggested by Shane Loretz:
https://github.com/ros/urdfdom/pull/157/files#r664959533

Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
  • Loading branch information
j-rivero committed Sep 17, 2021
1 parent f070fba commit 7fa83d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@ else()
find_package(TinyXML REQUIRED) # bionic has not cmake module
endif()
find_package(urdfdom_headers 1.0 REQUIRED)

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
# TODO: check Shane's comment https://github.com/ros/urdfdom/pull/157/files#r664959533
set(CMAKE_CXX_STANDARD 14)
endif()

find_package(console_bridge_vendor QUIET) # Provides console_bridge 0.4.0 on platforms without it.
find_package(console_bridge REQUIRED)

Expand Down
3 changes: 3 additions & 0 deletions urdf_parser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ macro(add_urdfdom_library)
${console_bridge_link_libs}
${urdfdom_headers_link_libs}
${TinyXML_LIBRARIES})
if(NOT CMAKE_CXX_STANDARD)
target_compile_features(${add_urdfdom_library_LIBNAME} PUBLIC cxx_std_14)
endif()
set_target_properties(${add_urdfdom_library_LIBNAME} PROPERTIES
DEFINE_SYMBOL URDFDOM_EXPORTS
SOVERSION ${URDF_MAJOR_MINOR_VERSION})
Expand Down

0 comments on commit 7fa83d8

Please sign in to comment.