aboutsummaryrefslogtreecommitdiff
path: root/ports/console-bridge
diff options
context:
space:
mode:
authorRobert Schumacher <roschuma@microsoft.com>2018-03-11 23:41:51 -0700
committerRobert Schumacher <roschuma@microsoft.com>2018-03-11 23:42:54 -0700
commit9f9778ccff48981a691bf34f30ecc4bf2efd5ac1 (patch)
tree10ec609d13836ddc266345f441bae6f9e824056a /ports/console-bridge
parentece289b9a6466dca885fd2555ed783d70dcad9bf (diff)
downloadvcpkg-9f9778ccff48981a691bf34f30ecc4bf2efd5ac1.tar.gz
vcpkg-9f9778ccff48981a691bf34f30ecc4bf2efd5ac1.zip
[many ports] Improve behavior on Linux and general cleanup
Diffstat (limited to 'ports/console-bridge')
-rw-r--r--ports/console-bridge/CONTROL2
-rw-r--r--ports/console-bridge/License.txt31
-rw-r--r--ports/console-bridge/portfile.cmake27
-rw-r--r--ports/console-bridge/static-macro.patch15
4 files changed, 39 insertions, 36 deletions
diff --git a/ports/console-bridge/CONTROL b/ports/console-bridge/CONTROL
index ea6ebf3ba..533c63944 100644
--- a/ports/console-bridge/CONTROL
+++ b/ports/console-bridge/CONTROL
@@ -1,3 +1,3 @@
Source: console-bridge
-Version: 0.3.2-2
+Version: 0.3.2-3
Description: a ROS-independent package for logging that seamlessly pipes into rosconsole/rosout for ROS-dependent packages.
diff --git a/ports/console-bridge/License.txt b/ports/console-bridge/License.txt
deleted file mode 100644
index affcb8568..000000000
--- a/ports/console-bridge/License.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Software License Agreement (BSD License)
-
-Copyright (c) 2008, Willow Garage, Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-* Neither the name of the Willow Garage nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
-ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file
diff --git a/ports/console-bridge/portfile.cmake b/ports/console-bridge/portfile.cmake
index d88308e5c..74d76923f 100644
--- a/ports/console-bridge/portfile.cmake
+++ b/ports/console-bridge/portfile.cmake
@@ -6,7 +6,12 @@ vcpkg_from_github(
REF 0.3.2
SHA512 41fa5340d7ba79c887ef73eb4fda7b438ed91febd224934ae4658697e4c9e43357207e1b3e191ecce3c97cb9a87b0556372832735a268261bc798cc7683aa207
HEAD_REF master
- )
+)
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/static-macro.patch
+)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
@@ -16,9 +21,23 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_copy_pdbs()
-vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake")
-file(RENAME ${CURRENT_PACKAGES_DIR}/share/console-bridge ${CURRENT_PACKAGES_DIR}/share/console_bridge)
+if(EXISTS ${CURRENT_PACKAGES_DIR}/CMake)
+ vcpkg_fixup_cmake_targets(CONFIG_PATH "CMake" TARGET_PATH share/console_bridge)
+else()
+ vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/console_bridge/cmake" TARGET_PATH share/console_bridge)
+endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/console-bridge RENAME copyright)
+file(READ ${SOURCE_PATH}/src/console.cpp _contents)
+string(SUBSTRING "${_contents}" 0 2000 license)
+file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/console-bridge)
+file(WRITE ${CURRENT_PACKAGES_DIR}/share/console-bridge/copyright "${license}")
+
+file(READ ${CURRENT_PACKAGES_DIR}/include/console_bridge/exportdecl.h _contents)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ string(REPLACE "ifdef CONSOLE_BRIDGE_STATIC" "if 1" _contents "${_contents}")
+else()
+ string(REPLACE "ifdef CONSOLE_BRIDGE_STATIC" "if 0" _contents "${_contents}")
+endif()
+file(WRITE ${CURRENT_PACKAGES_DIR}/include/console_bridge/exportdecl.h "${_contents}")
diff --git a/ports/console-bridge/static-macro.patch b/ports/console-bridge/static-macro.patch
new file mode 100644
index 000000000..31e4053aa
--- /dev/null
+++ b/ports/console-bridge/static-macro.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 604b2ab..e98b51c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -37,6 +37,10 @@ if(NOT DEFINED BUILD_SHARED_LIBS)
+ option(BUILD_SHARED_LIBS "Build dynamically-linked binaries" ON)
+ endif()
+
++if(NOT BUILD_SHARED_LIBS)
++ add_definitions(-DCONSOLE_BRIDGE_STATIC)
++endif()
++
+ add_library(${PROJECT_NAME} src/console.cpp)
+ set_target_properties(${PROJECT_NAME} PROPERTIES SOVERSION
+ ${CONSOLE_BRIDGE_MAJOR_VERSION}.${CONSOLE_BRIDGE_MINOR_VERSION})