Skip to content
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
43 changes: 43 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cmake_minimum_required(VERSION 3.5)

project(libyaml_vendor VERSION 1.0.0)

find_package(ament_cmake REQUIRED)

macro(build_libyaml)
set(extra_cmake_args)
if(DEFINED CMAKE_BUILD_TYPE)
list(APPEND extra_cmake_args -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
endif()

list(APPEND extra_cmake_args -DBUILD_SHARED_LIBS=ON)
list(APPEND extra_cmake_args -DBUILD_TESTING=OFF)
# Disable MSVC warnings
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
set(win_c_flags "${CMAKE_C_FLAGS} /wd4244 /wd4267 /wd4996")
list(APPEND extra_cmake_args -DCMAKE_C_FLAGS=${win_c_flags})
endif()

include(ExternalProject)
ExternalProject_Add(libyaml-10c9078
URL https://github.com/yaml/libyaml/archive/10c907871f1ccd779c7fccf6b81a62762b5c4e7b.zip
URL_MD5 b595f0ab0735c04c7f6ed0a798a3eff7
TIMEOUT 60
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/libyaml_install
${extra_cmake_args}
)

# The external project will install to the build folder, but we'll install that on make install.
install(
DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/libyaml_install/
DESTINATION
${CMAKE_INSTALL_PREFIX}
PATTERN config.h EXCLUDE
)
endmacro()

build_libyaml()

ament_package()
22 changes: 22 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<?xml-model
href="http://download.ros.org/schema/package_format2.xsd"
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>libyaml_vendor</name>
<version>1.0.0</version>
<description>
Wrapper around libyaml, provides the last version (1.8.0 rc) that ships with a CMake module
</description>
<maintainer email="mikael@osrfoundation.org">Mikael Arguedas</maintainer>
<license>Apache License 2.0</license> <!-- the contents of this package are Apache 2.0 -->
<license>MIT</license> <!-- libyaml is MIT -->

<url type="website">https://github.com/yaml/libyaml</url>

<buildtool_depend>ament_cmake</buildtool_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>