Skip to content

Commit

Permalink
[lcm] Disable unexpected components. Only install one flavor. Don't d…
Browse files Browse the repository at this point in the history
…elete DLL.
  • Loading branch information
ras0219-msft committed Mar 25, 2018
1 parent 21ef72d commit 9c6698a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ports/lcm/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: lcm
Version: 1.3.95
Version: 1.3.95-1
Build-Depends: glib
Description: Lightweight Communications and Marshalling (LCM)
LCM is a set of libraries and tools for message passing and data marshalling, targeted at real-time systems where high-bandwidth and low latency are critical. It provides a publish/subscribe message passing model and automatic marshalling/unmarshalling code generation with bindings for applications in a variety of programming languages.
19 changes: 19 additions & 0 deletions ports/lcm/only-install-one-flavor.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
diff --git a/lcm/CMakeLists.txt b/lcm/CMakeLists.txt
index a706a85..639ec12 100644
--- a/lcm/CMakeLists.txt
+++ b/lcm/CMakeLists.txt
@@ -76,8 +76,12 @@ endif()
target_include_directories(lcm-coretypes INTERFACE
$<BUILD_INTERFACE:${lcm_SOURCE_DIR}>
)
-
-install(TARGETS lcm-coretypes lcm-static lcm
+if(BUILD_SHARED_LIBS)
+ set(INSTALL_TARGETS lcm)
+else()
+ set(INSTALL_TARGETS lcm-static)
+endif()
+install(TARGETS lcm-coretypes ${INSTALL_TARGETS}
EXPORT lcmTargets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
30 changes: 26 additions & 4 deletions ports/lcm/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,24 @@ vcpkg_from_github(
HEAD_REF master
)

vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES ${CMAKE_CURRENT_LIST_DIR}/only-install-one-flavor.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DLCM_ENABLE_JAVA=OFF
-DLCM_ENABLE_LUA=OFF
-DLCM_ENABLE_PYTHON=OFF
-DLCM_ENABLE_TESTS=OFF
-DLCM_INSTALL_M4MACROS=OFF
-DLCM_INSTALL_PKGCONFIG=OFF
)

vcpkg_install_cmake()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
Expand All @@ -25,9 +34,22 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/aclocal)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/java)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/man)

file(COPY ${CURRENT_PACKAGES_DIR}/bin/lcm-gen.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/lcm)
file(GLOB EXES ${CURRENT_PACKAGES_DIR}/bin/*.exe)
if(EXES)
file(COPY ${EXES} DESTINATION ${CURRENT_PACKAGES_DIR}/tools/lcm)
file(REMOVE ${EXES})
endif()
file(GLOB DEBUG_EXES ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
if(DEBUG_EXES)
file(REMOVE ${DEBUG_EXES})
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/lcm)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)

file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/lcm RENAME copyright)

vcpkg_copy_pdbs()

0 comments on commit 9c6698a

Please sign in to comment.