aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzi-m <53815290+zi-m@users.noreply.github.com>2019-08-22 23:56:29 +0200
committerCurtis J Bezault <curtbezault@gmail.com>2019-08-22 14:56:29 -0700
commit9241e6c4b2ca8dbf8ec2c0997084d63bf48ce460 (patch)
tree785e0a8e4d1a8d3085c6f4db26ec1f07340ae256
parent95f9df71343c9c688336a0ac8489ae20ffc035e2 (diff)
downloadvcpkg-9241e6c4b2ca8dbf8ec2c0997084d63bf48ce460.tar.gz
vcpkg-9241e6c4b2ca8dbf8ec2c0997084d63bf48ce460.zip
[quickfast] Add new port (#7814)
* quickfast * replace 'noexcept' with BOOST_ASIO_NOEXCEPT
-rw-r--r--ports/quickfast/00001-fix-boost-asio.patch39
-rw-r--r--ports/quickfast/CMakeLists.txt54
-rw-r--r--ports/quickfast/CONTROL5
-rw-r--r--ports/quickfast/portfile.cmake50
-rw-r--r--ports/quickfast/usage4
5 files changed, 152 insertions, 0 deletions
diff --git a/ports/quickfast/00001-fix-boost-asio.patch b/ports/quickfast/00001-fix-boost-asio.patch
new file mode 100644
index 000000000..13a4cfa2a
--- /dev/null
+++ b/ports/quickfast/00001-fix-boost-asio.patch
@@ -0,0 +1,39 @@
+diff --git a/src/Common/QuickFASTPch.h b/src/Common/QuickFASTPch.h
+index 3574df8..c4ef4e1 100644
+--- a/src/Common/QuickFASTPch.h
++++ b/src/Common/QuickFASTPch.h
+@@ -32,7 +32,7 @@
+ #include <string.h>
+
+ // If building for .NET, must link boost threads dynamically
+-#define BOOST_THREAD_USE_DLL
++// #define BOOST_THREAD_USE_DLL
+ // This reports at compile time which boost libraries will be used
+ // #define BOOST_LIB_DIAGNOSTIC
+
+diff --git a/src/Communication/AsioService.h b/src/Communication/AsioService.h
+index 4f61915..96f2198 100644
+--- a/src/Communication/AsioService.h
++++ b/src/Communication/AsioService.h
+@@ -99,6 +99,7 @@ namespace QuickFAST
+ {
+ return ioService_;
+ }
++ boost::asio::io_service::executor_type get_executor() BOOST_ASIO_NOEXCEPT { return ioService_.get_executor();}
+
+ ///@brief Post a completion handler for later processing (usually in a different thread)
+ /// @param handler is the handler to be posted
+diff --git a/src/Communication/AsioService_fwd.h b/src/Communication/AsioService_fwd.h
+index dc2f235..6ad5e68 100644
+--- a/src/Communication/AsioService_fwd.h
++++ b/src/Communication/AsioService_fwd.h
+@@ -17,7 +17,8 @@ namespace boost
+ {
+ namespace asio
+ {
+- class io_service;
++ class io_context;
++ typedef io_context io_service;
+ }
+ }
+
diff --git a/ports/quickfast/CMakeLists.txt b/ports/quickfast/CMakeLists.txt
new file mode 100644
index 000000000..2464b6a25
--- /dev/null
+++ b/ports/quickfast/CMakeLists.txt
@@ -0,0 +1,54 @@
+cmake_minimum_required(VERSION 3.13)
+project(quickfast CXX)
+
+option(BUILD_SHARED_LIBS "Build shared instead of static library" ON)
+
+find_package(Boost REQUIRED COMPONENTS thread)
+find_package(XercesC REQUIRED)
+
+file(GLOB SOURCES
+ quickfast/Application/*.cpp
+ quickfast/Common/*.cpp
+ quickfast/Codecs/*.cpp
+ quickfast/Communication/*.cpp
+ quickfast/Messages/*.cpp
+)
+
+file(GLOB HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+ quickfast/Application/*.h
+ quickfast/Common/*.h
+ quickfast/Codecs/*.h
+ quickfast/Communication/*.h
+ quickfast/Messages/*.h
+)
+
+if(BUILD_SHARED_LIBS)
+ add_library(quickfast SHARED ${HEADERS} ${SOURCES})
+ target_compile_definitions(quickfast PRIVATE -DQUICKFAST_BUILD_DLL)
+else()
+ add_library(quickfast STATIC ${HEADERS} ${SOURCES})
+ target_compile_definitions(quickfast PUBLIC -DQUICKFAST_HAS_DLL=0)
+endif()
+
+target_include_directories(quickfast PUBLIC
+ $<INSTALL_INTERFACE:include>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
+ $<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
+)
+
+target_link_libraries(quickfast PRIVATE
+ ${Boost_LIBRARIES}
+ XercesC::XercesC
+)
+
+install(TARGETS quickfast EXPORT quickfast-config
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+)
+install(EXPORT quickfast-config DESTINATION share/cmake/quickfast)
+
+foreach (HEADER ${HEADERS} )
+ get_filename_component(HEADER_DIR ${HEADER} DIRECTORY)
+ install(FILES ${HEADER} DESTINATION include/${HEADER_DIR})
+endforeach()
diff --git a/ports/quickfast/CONTROL b/ports/quickfast/CONTROL
new file mode 100644
index 000000000..6f0ff5277
--- /dev/null
+++ b/ports/quickfast/CONTROL
@@ -0,0 +1,5 @@
+Source: quickfast
+Version: 1.5
+Build-Depends: boost-asio, xerces-c
+Homepage: https://github.com/objectcomputing/quickfast
+Description: QuickFAST is an Open Source native C++ implementation of the FAST Protocol [SM].
diff --git a/ports/quickfast/portfile.cmake b/ports/quickfast/portfile.cmake
new file mode 100644
index 000000000..7f3f6b8f4
--- /dev/null
+++ b/ports/quickfast/portfile.cmake
@@ -0,0 +1,50 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO objectcomputing/quickfast
+ REF V1_5
+ SHA512 f224ffbe0ee1b84616b46d536d27da01346103cf9ed135a87543da51e8e979ec3735e08ece8525ee1316ea323d41dcacc4d44eabe2e033d68f93432ea43d1ce9
+ HEAD_REF master
+ PATCHES 00001-fix-boost-asio.patch
+)
+
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+if(NOT EXISTS "${SOURCE_PATH}/quickfast")
+ file(RENAME ${SOURCE_PATH}/src ${SOURCE_PATH}/quickfast)
+endif()
+
+file(GLOB_RECURSE SRC_FILES "${SOURCE_PATH}/quickfast/*.cpp" "${SOURCE_PATH}/quickfast/*.h")
+foreach(SRC_FILE IN LISTS SRC_FILES)
+ file(READ "${SRC_FILE}" _contents)
+ string(REPLACE "#include <Common/" "#include <quickfast/Common/" _contents "${_contents}")
+ string(REPLACE "#include <Application/" "#include <quickfast/Application/" _contents "${_contents}")
+ string(REPLACE "#include <Communication/" "#include <quickfast/Communication/" _contents "${_contents}")
+ string(REPLACE "#include <Codecs/" "#include <quickfast/Codecs/" _contents "${_contents}")
+ string(REPLACE "#include <Messages/" "#include <quickfast/Messages/" _contents "${_contents}")
+ file(WRITE "${SRC_FILE}" "${_contents}")
+endforeach()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
+ set(BUILD_SHARED_LIBS ON)
+else()
+ set(BUILD_SHARED_LIBS OFF)
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS
+ -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}
+ PREFER_NINJA
+)
+
+vcpkg_install_cmake()
+vcpkg_copy_pdbs()
+vcpkg_fixup_cmake_targets(CONFIG_PATH share/cmake/quickfast)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+
+configure_file(${SOURCE_PATH}/license.txt ${CURRENT_PACKAGES_DIR}/share/quickfast/copyright COPYONLY)
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/quickfast)
diff --git a/ports/quickfast/usage b/ports/quickfast/usage
new file mode 100644
index 000000000..26c4bea21
--- /dev/null
+++ b/ports/quickfast/usage
@@ -0,0 +1,4 @@
+The package quickfast provides CMake targets:
+
+ find_package(quickfast CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE quickfast)