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 + + // 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 + $ + $ + $ +) + +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