Skip to content

Commit

Permalink
quickfast: link against Boost::thread
Browse files Browse the repository at this point in the history
  • Loading branch information
valgur committed Jan 20, 2024
1 parent bd5d4ae commit 64eda62
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 47 deletions.
56 changes: 15 additions & 41 deletions recipes/quickfast/all/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,49 +1,23 @@
# based on: https://github.com/microsoft/vcpkg/blob/master/ports/quickfast/CMakeLists.txt

# Copyright (c) Microsoft Corporation

# All rights reserved.

# MIT License

# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
# of the Software, and to permit persons to whom the Software is furnished to do
# so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.15)
project(quickfast CXX)

find_package(Boost REQUIRED CONFIG)
find_package(XercesC REQUIRED CONFIG)

file(GLOB SOURCES
src/src/Application/*.cpp
src/src/Common/*.cpp
src/src/Codecs/*.cpp
src/src/Communication/*.cpp
src/src/Messages/*.cpp
src/Application/*.cpp
src/Common/*.cpp
src/Codecs/*.cpp
src/Communication/*.cpp
src/Messages/*.cpp
)

file(GLOB HEADERS RELATIVE ${PROJECT_SOURCE_DIR}
src/src/Application/*.h
src/src/Common/*.h
src/src/Codecs/*.h
src/src/Communication/*.h
src/src/Messages/*.h
file(GLOB HEADERS
src/Application/*.h
src/Common/*.h
src/Codecs/*.h
src/Communication/*.h
src/Messages/*.h
)

add_library(quickfast ${HEADERS} ${SOURCES})
Expand All @@ -58,8 +32,8 @@ else()
endif()

target_compile_features(quickfast PUBLIC cxx_std_11)
target_include_directories(quickfast PUBLIC src/src)
target_link_libraries(${PROJECT_NAME} Boost::boost XercesC::XercesC)
target_include_directories(quickfast PUBLIC src)
target_link_libraries(${PROJECT_NAME} Boost::boost Boost::thread Boost::date_time XercesC::XercesC)

install(TARGETS quickfast
RUNTIME DESTINATION bin
Expand All @@ -68,7 +42,7 @@ install(TARGETS quickfast
)

foreach (HEADER ${HEADERS})
file(RELATIVE_PATH HEADER_REL ${PROJECT_SOURCE_DIR}/src/src ${PROJECT_SOURCE_DIR}/${HEADER})
file(RELATIVE_PATH HEADER_REL ${PROJECT_SOURCE_DIR}/src ${HEADER})
get_filename_component(HEADER_DIR ${HEADER_REL} DIRECTORY)
install(FILES ${HEADER} DESTINATION include/quickfast/${HEADER_DIR})
endforeach()
17 changes: 11 additions & 6 deletions recipes/quickfast/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class QuickfastConan(ConanFile):
description = "QuickFAST is an Open Source native C++ implementation of the FAST Protocol"
license = "BSD-3-Clause"
url = "https://github.com/conan-io/conan-center-index"
homepage = "https://objectcomputing.com/"
homepage = "https://github.com/objectcomputing/quickfast"
topics = ("QuickFAST", "FAST", "FIX", "Fix Adapted for STreaming", "Financial Information Exchange")

package_type = "library"
Expand All @@ -28,7 +28,7 @@ class QuickfastConan(ConanFile):
}

def export_sources(self):
copy(self, "CMakeLists.txt", src=self.recipe_folder, dst=self.export_sources_folder)
copy(self, "CMakeLists.txt", self.recipe_folder, os.path.join(self.export_sources_folder, "src"))
export_conandata_patches(self)

def config_options(self):
Expand Down Expand Up @@ -63,15 +63,13 @@ def generate(self):
def build(self):
apply_conandata_patches(self)
cmake = CMake(self)
cmake.configure(build_script_folder=self.source_path.parent)
cmake.configure()
cmake.build()

def package(self):
copy(self, "license.txt", self.source_folder, os.path.join(self.package_folder, "licenses"))
cmake = CMake(self)
cmake.install()
copy(self, "license.txt",
dst=os.path.join(self.package_folder, "licenses"),
src=self.source_folder)

def package_info(self):
self.cpp_info.libs = ["quickfast"]
Expand All @@ -82,3 +80,10 @@ def package_info(self):

if not self.options.shared:
self.cpp_info.defines.append("QUICKFAST_HAS_DLL=0")

self.cpp_info.requires = [
"boost::headers",
"boost::thread",
"boost::date_time",
"xerces-c::xerces-c"
]

0 comments on commit 64eda62

Please sign in to comment.