Skip to content

Commit

Permalink
rework c++11 flag logic
Browse files Browse the repository at this point in the history
to support system default compile options again.

needed for c++17 upward requirements in upstream libraries
  • Loading branch information
v4hn authored Oct 10, 2024
1 parent b24715a commit a8d2e49
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ pkg_check_modules(bullet REQUIRED bullet)
find_package( PCL REQUIRED )
add_definitions(${PCL_DEFINITIONS})
if(CMAKE_COMPILER_IS_GNUCXX)
if("${PCL_VERSION}" VERSION_GREATER "1.9") # PCL > 1.10 needs c++14
set(CMAKE_CXX_FLAGS "-std=c++14 ${CMAKE_CXX_FLAGS}")
else()
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
# PCL < 1.10 needs c++11, which wasn't the default on targeted systems yet
if("${PCL_VERSION}" VERSION_LESS "1.10")
add_compile_options(-std=c++11)
endif()
endif()

Expand Down

0 comments on commit a8d2e49

Please sign in to comment.