aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Sinigardi <stesinigardi@hotmail.com>2019-03-22 07:17:13 +0100
committerPhil Christensen <philc@microsoft.com>2019-03-21 23:17:13 -0700
commitde4add711d578c2872eaf3a0cbbab719448dbaff (patch)
tree0747c609d4c18bf49f70af2065f6aed7d38cacdd
parent6e8725ba64ffd81650d67feb5ecc69b6df4b4307 (diff)
downloadvcpkg-de4add711d578c2872eaf3a0cbbab719448dbaff.tar.gz
vcpkg-de4add711d578c2872eaf3a0cbbab719448dbaff.zip
[freeopcua] better dealing with dynamic builds (#5763)
* [freeopcua] better dealing with dynamic builds
-rw-r--r--ports/freeopcua/CONTROL2
-rw-r--r--ports/freeopcua/cmakelists_fixes.patch84
-rw-r--r--ports/freeopcua/portfile.cmake5
3 files changed, 62 insertions, 29 deletions
diff --git a/ports/freeopcua/CONTROL b/ports/freeopcua/CONTROL
index ad224b863..b6d20b57a 100644
--- a/ports/freeopcua/CONTROL
+++ b/ports/freeopcua/CONTROL
@@ -1,4 +1,4 @@
Source: freeopcua
-Version: 20190125
+Version: 20190125-1
Description: OPC-UA server and client library written in C++ and with a lot of code auto-generated from xml specification using python.
Build-Depends: boost-asio,boost-system,boost-program-options,boost-filesystem,boost-thread,boost-format,boost-foreach,boost-property-tree,boost-date-time
diff --git a/ports/freeopcua/cmakelists_fixes.patch b/ports/freeopcua/cmakelists_fixes.patch
index 6c9798766..f818eab35 100644
--- a/ports/freeopcua/cmakelists_fixes.patch
+++ b/ports/freeopcua/cmakelists_fixes.patch
@@ -1,17 +1,22 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index de03564..2637355 100644
+index de03564..df3fcf6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -6,6 +6,8 @@ if( NOT CMAKE_BUILD_TYPE )
- endif()
+@@ -1,11 +1,8 @@
+ cmake_minimum_required(VERSION 2.8)
+-#It seems Cmake does not set default bild type so we force it
+-if( NOT CMAKE_BUILD_TYPE )
+- set( CMAKE_BUILD_TYPE Debug CACHE STRING "Debug" FORCE )
+-endif()
+-
project(freeopcua)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
option(BUILD_CLIENT "Build Client" ON)
option(BUILD_SERVER "Build Server" ON)
-@@ -16,28 +18,6 @@ option(BUILD_PYTHON "Build Python bindings" ON)
+@@ -16,28 +13,6 @@ option(BUILD_PYTHON "Build Python bindings" ON)
option(BUILD_TESTING "Build and run tests" OFF)
OPTION(BUILD_SHARED_LIBS "Build shared libraries." ON)
@@ -40,7 +45,7 @@ index de03564..2637355 100644
# Helper function to generate a pkg-config file for a single library
# Takes the filename of the .pc file as a parameter and replaces all
# placeholders in the .pc.in file with the actual values
-@@ -60,23 +40,12 @@ function(generate_pkgconfig BASENAME)
+@@ -60,23 +35,9 @@ function(generate_pkgconfig BASENAME)
endif()
endfunction(generate_pkgconfig)
if(MSVC)
@@ -63,14 +68,11 @@ index de03564..2637355 100644
- #set(CMAKE_SHARED_LINKER_FLAGS "--no-undefined" )
+ add_definitions(-D_SCL_SECURE_NO_WARNINGS)
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-+ add_definitions(-D_WIN32)
-+ add_definitions(-D_WINDOWS)
-+ add_definitions(-D_WIN32_WINNT=0x0600)
+ set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
endif()
if(WIN32)
-@@ -105,7 +74,7 @@ else(WIN32)
+@@ -105,7 +66,7 @@ else(WIN32)
endif(WIN32)
@@ -79,7 +81,7 @@ index de03564..2637355 100644
include_directories( ${Boost_INCLUDE_DIRS} )
link_directories( ${Boost_LIBRARY_DIRS} )
message(STATUS "Boost INCLUDE DIR IS: " ${Boost_INCLUDE_DIRS})
-@@ -185,9 +154,6 @@ add_library(opcuaprotocol
+@@ -185,14 +146,12 @@ add_library(opcuaprotocol
src/protocol/subscriptions.cpp
)
@@ -89,7 +91,14 @@ index de03564..2637355 100644
target_link_libraries(opcuaprotocol ${ADDITIONAL_LINK_LIBRARIES})
target_include_directories(opcuaprotocol PUBLIC $<INSTALL_INTERFACE:include>)
install(TARGETS opcuaprotocol EXPORT FreeOpcUa
-@@ -227,10 +193,6 @@ if (BUILD_TESTING)
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ generate_pkgconfig("libopcuaprotocol.pc")
+
+@@ -227,10 +186,6 @@ if (BUILD_TESTING)
gtest_main
)
@@ -100,7 +109,7 @@ index de03564..2637355 100644
add_test(NAME opcuaprotocol COMMAND test_opcuaprotocol)
endif()
-@@ -266,11 +228,7 @@ SET(opcuacore_SOURCES
+@@ -266,15 +221,12 @@ SET(opcuacore_SOURCES
add_library(opcuacore ${opcuacore_SOURCES})
@@ -112,17 +121,23 @@ index de03564..2637355 100644
+target_link_libraries(opcuacore ${ADDITIONAL_LINK_LIBRARIES} opcuaprotocol ${Boost_LIBRARIES})
target_include_directories(opcuacore PUBLIC $<INSTALL_INTERFACE:include>)
install(TARGETS opcuacore EXPORT FreeOpcUa
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-@@ -306,7 +264,7 @@ if (BUILD_TESTING)
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ generate_pkgconfig("libopcuacore.pc")
+
+@@ -306,7 +258,7 @@ if (BUILD_TESTING)
)
if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
- target_compile_options(test_opcuacore PUBLIC ${D}DYNAMIC_ADDON_PATH="${DYNAMIC_ADDON_PATH}" ${D}TEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}" ${EXECUTABLE_CXX_FLAGS})
-+ target_compile_options(test_opcuacore PUBLIC ${D}DYNAMIC_ADDON_PATH="${DYNAMIC_ADDON_PATH}" ${D}TEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}" )
++ target_compile_options(test_opcuacore PUBLIC -DDYNAMIC_ADDON_PATH="${DYNAMIC_ADDON_PATH}" -DTEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}" )
endif ()
add_test(NAME opcuacore COMMAND test_opcuacore)
-@@ -327,9 +285,6 @@ if (BUILD_CLIENT)
+@@ -327,9 +279,6 @@ if (BUILD_CLIENT)
src/client/client.cpp
)
@@ -132,7 +147,18 @@ index de03564..2637355 100644
target_link_libraries(opcuaclient
opcuacore
${ADDITIONAL_LINK_LIBRARIES}
-@@ -371,9 +326,6 @@ if (BUILD_CLIENT)
+@@ -338,8 +287,9 @@ if (BUILD_CLIENT)
+
+ target_include_directories(opcuaclient PUBLIC $<INSTALL_INTERFACE:include>)
+ install(TARGETS opcuaclient EXPORT FreeOpcUa
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ generate_pkgconfig("libopcuaclient.pc")
+
+@@ -371,9 +321,6 @@ if (BUILD_CLIENT)
opcuacore
)
@@ -142,7 +168,7 @@ index de03564..2637355 100644
endif(BUILD_CLIENT)
-@@ -423,10 +375,7 @@ if(BUILD_SERVER)
+@@ -423,14 +370,12 @@ if(BUILD_SERVER)
src/server/subscription_service_internal.cpp
)
@@ -153,17 +179,23 @@ index de03564..2637355 100644
+ target_link_libraries(opcuaserver ${ADDITIONAL_LINK_LIBRARIES} opcuacore opcuaprotocol ${Boost_LIBRARIES})
target_include_directories(opcuaserver PUBLIC $<INSTALL_INTERFACE:include>)
install(TARGETS opcuaserver EXPORT FreeOpcUa
++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
-@@ -481,7 +430,7 @@ if(BUILD_SERVER)
+- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+ generate_pkgconfig("libopcuaserver.pc")
+
+@@ -481,7 +426,7 @@ if(BUILD_SERVER)
target_include_directories(test_opcuaserver PUBLIC .)
if (NOT CMAKE_VERSION VERSION_LESS 2.8.12)
- target_compile_options(test_opcuaserver PUBLIC ${D}TEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}" ${STATIC_LIBRARY_CXX_FLAGS})
-+ target_compile_options(test_opcuaserver PUBLIC ${D}TEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}")
++ target_compile_options(test_opcuaserver PUBLIC -DTEST_CORE_CONFIG_PATH="${TEST_CORE_CONFIG_PATH}")
endif ()
add_test(NAME opcuaserverapp COMMAND test_opcuaserver)
-@@ -510,9 +459,6 @@ if(BUILD_SERVER)
+@@ -510,9 +455,6 @@ if(BUILD_SERVER)
opcuaserver
${Boost_PROGRAM_OPTIONS_LIBRARY}
)
@@ -173,7 +205,7 @@ index de03564..2637355 100644
endif(BUILD_SERVER)
-@@ -533,9 +479,6 @@ if (BUILD_CLIENT)
+@@ -533,9 +475,6 @@ if (BUILD_CLIENT)
${SSL_SUPPORT_LINK_LIBRARIES}
)
@@ -183,7 +215,7 @@ index de03564..2637355 100644
endif (BUILD_CLIENT)
-@@ -555,9 +498,6 @@ if(BUILD_SERVER)
+@@ -555,9 +494,6 @@ if(BUILD_SERVER)
opcuaserver
)
@@ -193,12 +225,14 @@ index de03564..2637355 100644
if(MSVC)
set_target_properties(example_server PROPERTIES LINK_FLAGS /STACK:3000000)
endif(MSVC)
-@@ -572,7 +512,7 @@ if (BUILD_PYTHON)
+@@ -572,8 +508,8 @@ if (BUILD_PYTHON)
add_subdirectory(python)
endif (BUILD_PYTHON)
-install(EXPORT FreeOpcUa DESTINATION lib/cmake/FreeOpcUa FILE FreeOpcUaConfig.cmake)
-+install(EXPORT FreeOpcUa DESTINATION share/freeopcua FILE FreeOpcUaConfig.cmake)
++install(EXPORT FreeOpcUa DESTINATION share/freeopcua FILE freeopcuaConfig.cmake)
SET(CPACK_GENERATOR "DEB")
- SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "FreeOpcUa")
+-SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "FreeOpcUa")
++SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "freeopcua")
+ INCLUDE(CPack)
diff --git a/ports/freeopcua/portfile.cmake b/ports/freeopcua/portfile.cmake
index e329f12e6..981dd9383 100644
--- a/ports/freeopcua/portfile.cmake
+++ b/ports/freeopcua/portfile.cmake
@@ -22,12 +22,11 @@ vcpkg_configure_cmake(
-DBUILD_PYTHON=OFF
-DBUILD_TESTING=OFF
-DSSL_SUPPORT_MBEDTLS=OFF
+ -DCMAKE_DEBUG_POSTFIX=d
)
vcpkg_install_cmake()
-
-file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share/freeopcua/FreeOpcUaConfig-debug.cmake ${CURRENT_PACKAGES_DIR}/share/freeopcua/FreeOpcUaConfig-debug.cmake)
-file(RENAME ${CURRENT_PACKAGES_DIR}/debug/share/freeopcua/FreeOpcUaConfig.cmake ${CURRENT_PACKAGES_DIR}/share/freeopcua/FreeOpcUaConfig.cmake)
+vcpkg_fixup_cmake_targets()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)