Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Drop support for yaml-cpp old API #450

Merged
merged 7 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ jobs:
gcc \
make \
libeigen3-dev \
libyaml-cpp-dev \
ninja-build \
catch \
libomp-dev \
Expand Down
50 changes: 12 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ endforeach()
# initially
set(EXTERNAL_LIBS "")

# compile local version of gtest and yaml-cpp
# compile local version of gtest
add_subdirectory(contrib)

#---------------------------
Expand Down Expand Up @@ -215,41 +215,19 @@ endif()


#--------------------
# DEPENDENCY: yaml-cpp (local or system, optional)
# DEPENDENCY: yaml-cpp
#--------------------
option(USE_SYSTEM_YAML_CPP "Use system version of yaml-cpp rather than one packaged with libpointmatcher" FALSE)

if(USE_SYSTEM_YAML_CPP)
message(STATUS "Looking for yaml-cpp on system")
find_path(yaml-cpp_INCLUDE_DIRS yaml-cpp/yaml.h
/usr/local/include
)
find_library(yaml-cpp_LIBRARIES yaml-cpp PATHS
/usr/local/lib
)
if(yaml-cpp_INCLUDE_DIRS AND yaml-cpp_LIBRARIES)
set(yamlcpp_FOUND)
message("-- yaml-cpp found, text-based configuration enabled")
else()
message("-- yaml-cpp not found, text-based configuration and related applications disabled")
endif()
else()
include_directories(contrib/yaml-cpp-pm/include)

#note: this is not working....
#get_property(yaml-cpp-pm_INCLUDE TARGET yaml-cpp-pm PROPERTY INCLUDE_DIRECTORIES)
#include_directories(${yaml-cpp-pm_INCLUDE})
message(STATUS "Looking for yaml-cpp on system...")

list(APPEND EXTERNAL_LIBS $<TARGET_FILE:yaml-cpp-pm>)
list(APPEND EXTRA_DEPS yaml-cpp-pm)
set(yamlcpp_FOUND)
find_package(yaml-cpp QUIET)

get_property(yaml-cpp-pm_VERSION TARGET yaml-cpp-pm PROPERTY VERSION)
message("-- using built-in yaml-cpp, version ${yaml-cpp-pm_VERSION}")
message(" -- text-based configuration enabled")
if(yaml-cpp_FOUND)
message(STATUS "yaml-cpp version ${yaml-cpp_VERSION} found, text-based configuration enabled")
else()
message(STATUS "yaml-cpp not found, text-based configuration and related applications disabled")
endif()


#--------------------
# DEPENDENCY: rt (optional)
#--------------------
Expand Down Expand Up @@ -390,13 +368,9 @@ else()
target_compile_options(pointmatcher PRIVATE /bigobj)
endif()

if(yaml-cpp_INCLUDE_DIRS AND yaml-cpp_LIBRARIES)
target_link_libraries(pointmatcher PRIVATE ${yaml-cpp_LIBRARIES})
target_include_directories(pointmatcher PRIVATE ${yaml-cpp_INCLUDE_DIRS})
else() # embedded version:
# This could be enabled if yaml-cpp-pm was in the "export set"
#target_link_libraries(pointmatcher PRIVATE yaml-cpp-pm)
# For now, let's add yaml-cpp-pm output to EXTERNAL_LIBS
if(yaml-cpp_FOUND)
target_link_libraries(pointmatcher PUBLIC ${YAML_CPP_LIBRARIES})
target_include_directories(pointmatcher PUBLIC ${YAML_CPP_INCLUDE_DIR})
endif()

target_link_libraries(pointmatcher PUBLIC ${Boost_LIBRARIES})
Expand Down Expand Up @@ -541,7 +515,7 @@ set(CONF_INCLUDE_DIRS ${INSTALL_INCLUDE_DIR} ${CONF_INCLUDE_DIRS} )
#FIXME: this will only be applied to installed files. Confirm that we want that.
# gather all the includes but remove ones in the source tree
# because we added an include for the local yaml-cpp-pm we should also remove it
list(REMOVE_ITEM CONF_INCLUDE_DIRS ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/contrib/yaml-cpp-pm/include)
list(REMOVE_ITEM CONF_INCLUDE_DIRS ${CMAKE_SOURCE_DIR})

# We put the generated file for installation in a different repository (i.e., ./CMakeFiles/)
configure_file(libpointmatcherConfig.cmake.in
Expand Down
5 changes: 0 additions & 5 deletions contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,3 @@
# GTest
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_library(gtest gtest/gtest-all.cc)

# Wrapped yaml-cpp
if(NOT USE_SYSTEM_YAML_CPP)
add_subdirectory(yaml-cpp-pm)
endif()
129 changes: 0 additions & 129 deletions contrib/yaml-cpp-pm/CMakeLists.txt

This file was deleted.

34 changes: 0 additions & 34 deletions contrib/yaml-cpp-pm/include/yaml-cpp-pm/aliasmanager.h

This file was deleted.

16 changes: 0 additions & 16 deletions contrib/yaml-cpp-pm/include/yaml-cpp-pm/anchor.h

This file was deleted.

66 changes: 0 additions & 66 deletions contrib/yaml-cpp-pm/include/yaml-cpp-pm/binary.h

This file was deleted.

Loading