Skip to content

Commit

Permalink
{rolling} fmilibrary-vendor update patch to apply on 1.0.1-1 version
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Jansa <martin.jansa@lge.com>
  • Loading branch information
shr-project committed Apr 17, 2021
1 parent dae2791 commit 8da5b93
Showing 1 changed file with 19 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From a2b01c8d9bd3e8f502dd96a51f8c0abbcf929559 Mon Sep 17 00:00:00 2001
From 33e51b8740b71de2f2d0b773b28fb7b771938558 Mon Sep 17 00:00:00 2001
From: Martin Jansa <martin.jansa@lge.com>
Date: Fri, 29 Nov 2019 19:03:46 -0800
Subject: [PATCH] CMakeLists.txt: just depend on system fmilibrary without
Expand All @@ -10,50 +10,41 @@ Upstream-Status: Pending

Signed-off-by: Martin Jansa <martin.jansa@lge.com>
---
CMakeLists.txt | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
CMakeLists.txt | 23 +++++++----------------
1 file changed, 7 insertions(+), 16 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index adb4abf..31b3468 100644
index df8d628..cc59cde 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,19 +3,27 @@ project(fmilibrary_vendor)
@@ -3,23 +3,14 @@ project(fmilibrary_vendor)

find_package(ament_cmake REQUIRED)

-include(ExternalProject)
-externalproject_add(FMILibraryProject
-set(fmilibrary_version 2.2.3)
-externalproject_add(FMILibraryProject-${fmilibrary_version}
- GIT_REPOSITORY https://github.com/modelon-community/fmi-library.git
- GIT_TAG 2.1
- GIT_TAG ${fmilibrary_version}
- GIT_CONFIG advice.detachedHead=false
- # Suppress git update due to https://gitlab.kitware.com/cmake/cmake/-/issues/16419
- UPDATE_COMMAND ""
- TIMEOUT 60
-)
-externalproject_get_property(FMILibraryProject INSTALL_DIR)
-externalproject_get_property(FMILibraryProject-${fmilibrary_version} INSTALL_DIR)
-set(FMILibraryProject_INCLUDE_DIR "${INSTALL_DIR}/src/install/include")
-set(FMILibraryProject_LIB_DIR "${INSTALL_DIR}/src/install/lib")
+find_package(fmilibrary)
+#find_package(PkgConfig REQUIRED)
+#pkg_check_modules(FMILIBRARY REQUIRED fmilibrary)

-install(DIRECTORY ${FMILibraryProject_INCLUDE_DIR}/ DESTINATION include)
-install(FILES ${FMILibraryProject_LIB_DIR}/libfmilib.a DESTINATION lib)
-install(FILES ${FMILibraryProject_LIB_DIR}/libfmilib_shared.so DESTINATION lib)
+# fmilibrary doesn't support CMake
+# if(NOT fmilibrary_FOUND)
+if (false)
+ include(ExternalProject)
+ externalproject_add(FMILibraryProject
+ GIT_REPOSITORY https://github.com/modelon-community/fmi-library.git
+ GIT_TAG 2.1
+ TIMEOUT 60
+ )
+ externalproject_get_property(FMILibraryProject INSTALL_DIR)
+ set(FMILibraryProject_INCLUDE_DIR "${INSTALL_DIR}/src/install/include")
+ set(FMILibraryProject_LIB_DIR "${INSTALL_DIR}/src/install/lib")
+
+ install(DIRECTORY ${FMILibraryProject_INCLUDE_DIR}/ DESTINATION include)
+ install(FILES ${FMILibraryProject_LIB_DIR}/libfmilib.a DESTINATION lib)
+ install(FILES ${FMILibraryProject_LIB_DIR}/libfmilib_shared.so DESTINATION lib)
+else()
+ message(STATUS "Found fmilibrary ${fmilibrary_VERSION}")
+endif()
+#if(FMILIBRARY_FOUND)
+# message(STATUS "Found fmilibrary ${FMILIBRARY_VERSION}")
+#else()
+# message(FATAL_ERROR "fmilibrary not found -- missing from DEPENDS?")
+#endif()

ament_export_include_directories(include)
ament_export_libraries(libfmilib.a libfmilib_shared.so)

0 comments on commit 8da5b93

Please sign in to comment.