generated from Sithas/conan_template
Initial commit
This commit is contained in:
commit
431b183e01
28
CMakeLists.txt
Normal file
28
CMakeLists.txt
Normal file
@ -0,0 +1,28 @@
|
||||
cmake_minimum_required(VERSION 3.11)
|
||||
|
||||
project(App CXX)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
|
||||
find_package(Boost 1.84.0 REQUIRED)
|
||||
if(Boost_FOUND)
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
add_executable(application src/main.cpp
|
||||
src/helpers.h
|
||||
src/helper.cpp
|
||||
src/sdk.h
|
||||
src/Session.h
|
||||
src/Session.cpp
|
||||
src/Listener.h
|
||||
src/Listener.cpp
|
||||
src/content_type.h
|
||||
src/RequestHandlers/BasicRequestHandler.cpp
|
||||
src/RequestHandlers/BasicRequestHandler.h)
|
||||
target_link_libraries(application PRIVATE Threads::Threads)
|
42
build/conan.lock
Normal file
42
build/conan.lock
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
"graph_lock": {
|
||||
"nodes": {
|
||||
"0": {
|
||||
"options": "boost:asio_no_deprecated=False\nboost:buildid=None\nboost:bzip2=True\nboost:debug_level=0\nboost:diagnostic_definitions=False\nboost:error_code_header_only=False\nboost:extra_b2_flags=None\nboost:filesystem_no_deprecated=False\nboost:filesystem_use_std_fs=False\nboost:filesystem_version=None\nboost:header_only=False\nboost:i18n_backend=deprecated\nboost:i18n_backend_iconv=off\nboost:i18n_backend_icu=False\nboost:layout=system\nboost:lzma=False\nboost:magic_autolink=False\nboost:multithreading=True\nboost:namespace=boost\nboost:namespace_alias=False\nboost:pch=True\nboost:python_executable=None\nboost:python_version=None\nboost:segmented_stacks=False\nboost:shared=False\nboost:system_no_deprecated=False\nboost:system_use_utf8=False\nboost:visibility=hidden\nboost:without_atomic=False\nboost:without_chrono=False\nboost:without_cobalt=True\nboost:without_container=False\nboost:without_context=False\nboost:without_contract=False\nboost:without_coroutine=False\nboost:without_date_time=False\nboost:without_exception=False\nboost:without_fiber=True\nboost:without_filesystem=False\nboost:without_graph=False\nboost:without_graph_parallel=True\nboost:without_iostreams=False\nboost:without_json=False\nboost:without_locale=False\nboost:without_log=False\nboost:without_math=False\nboost:without_mpi=True\nboost:without_nowide=False\nboost:without_program_options=False\nboost:without_python=True\nboost:without_random=False\nboost:without_regex=False\nboost:without_serialization=False\nboost:without_stacktrace=False\nboost:without_system=False\nboost:without_test=False\nboost:without_thread=False\nboost:without_timer=False\nboost:without_type_erasure=False\nboost:without_url=False\nboost:without_wave=False\nboost:zlib=True\nboost:zstd=False\nbzip2:build_executable=True\nbzip2:shared=False\nzlib:shared=False",
|
||||
"requires": [
|
||||
"1"
|
||||
],
|
||||
"path": "..\\conanfile.txt",
|
||||
"context": "host"
|
||||
},
|
||||
"1": {
|
||||
"ref": "boost/1.84.0",
|
||||
"options": "asio_no_deprecated=False\nbuildid=None\nbzip2=True\ndebug_level=0\ndiagnostic_definitions=False\nerror_code_header_only=False\nextra_b2_flags=None\nfilesystem_no_deprecated=False\nfilesystem_use_std_fs=False\nfilesystem_version=None\nheader_only=False\ni18n_backend=deprecated\ni18n_backend_iconv=off\ni18n_backend_icu=False\nlayout=system\nlzma=False\nmagic_autolink=False\nmultithreading=True\nnamespace=boost\nnamespace_alias=False\npch=True\npython_executable=None\npython_version=None\nsegmented_stacks=False\nshared=False\nsystem_no_deprecated=False\nsystem_use_utf8=False\nvisibility=hidden\nwithout_atomic=False\nwithout_chrono=False\nwithout_cobalt=True\nwithout_container=False\nwithout_context=False\nwithout_contract=False\nwithout_coroutine=False\nwithout_date_time=False\nwithout_exception=False\nwithout_fiber=True\nwithout_filesystem=False\nwithout_graph=False\nwithout_graph_parallel=True\nwithout_iostreams=False\nwithout_json=False\nwithout_locale=False\nwithout_log=False\nwithout_math=False\nwithout_mpi=True\nwithout_nowide=False\nwithout_program_options=False\nwithout_python=True\nwithout_random=False\nwithout_regex=False\nwithout_serialization=False\nwithout_stacktrace=False\nwithout_system=False\nwithout_test=False\nwithout_thread=False\nwithout_timer=False\nwithout_type_erasure=False\nwithout_url=False\nwithout_wave=False\nzlib=True\nzstd=False\nbzip2:build_executable=True\nbzip2:shared=False\nzlib:shared=False",
|
||||
"package_id": "e50863e182b9f1a9ce9e711c031065f1fe5f7f78",
|
||||
"prev": "0",
|
||||
"requires": [
|
||||
"2",
|
||||
"3"
|
||||
],
|
||||
"context": "host"
|
||||
},
|
||||
"2": {
|
||||
"ref": "zlib/1.3.1",
|
||||
"options": "shared=False",
|
||||
"package_id": "5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b",
|
||||
"prev": "0",
|
||||
"context": "host"
|
||||
},
|
||||
"3": {
|
||||
"ref": "bzip2/1.0.8",
|
||||
"options": "build_executable=True\nshared=False",
|
||||
"package_id": "53b5fd22ba061620078deefdae9a437c5f693201",
|
||||
"prev": "0",
|
||||
"context": "host"
|
||||
}
|
||||
},
|
||||
"revisions_enabled": false
|
||||
},
|
||||
"version": "0.4",
|
||||
"profile_host": "[settings]\narch=x86_64\narch_build=x86_64\nbuild_type=Release\ncompiler=Visual Studio\ncompiler.runtime=MD\ncompiler.version=17\nos=Windows\nos_build=Windows\n[options]\n[build_requires]\n[env]\n"
|
||||
}
|
1020
build/conanbuildinfo.cmake
Normal file
1020
build/conanbuildinfo.cmake
Normal file
@ -0,0 +1,1020 @@
|
||||
include(CMakeParseArguments)
|
||||
|
||||
macro(conan_find_apple_frameworks FRAMEWORKS_FOUND FRAMEWORKS SUFFIX BUILD_TYPE)
|
||||
if(APPLE)
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
set(_BTYPE ${CMAKE_BUILD_TYPE})
|
||||
elseif(NOT BUILD_TYPE STREQUAL "")
|
||||
set(_BTYPE ${BUILD_TYPE})
|
||||
endif()
|
||||
if(_BTYPE)
|
||||
if(${_BTYPE} MATCHES "Debug|_DEBUG")
|
||||
set(CONAN_FRAMEWORKS${SUFFIX} ${CONAN_FRAMEWORKS${SUFFIX}_DEBUG} ${CONAN_FRAMEWORKS${SUFFIX}})
|
||||
set(CONAN_FRAMEWORK_DIRS${SUFFIX} ${CONAN_FRAMEWORK_DIRS${SUFFIX}_DEBUG} ${CONAN_FRAMEWORK_DIRS${SUFFIX}})
|
||||
elseif(${_BTYPE} MATCHES "Release|_RELEASE")
|
||||
set(CONAN_FRAMEWORKS${SUFFIX} ${CONAN_FRAMEWORKS${SUFFIX}_RELEASE} ${CONAN_FRAMEWORKS${SUFFIX}})
|
||||
set(CONAN_FRAMEWORK_DIRS${SUFFIX} ${CONAN_FRAMEWORK_DIRS${SUFFIX}_RELEASE} ${CONAN_FRAMEWORK_DIRS${SUFFIX}})
|
||||
elseif(${_BTYPE} MATCHES "RelWithDebInfo|_RELWITHDEBINFO")
|
||||
set(CONAN_FRAMEWORKS${SUFFIX} ${CONAN_FRAMEWORKS${SUFFIX}_RELWITHDEBINFO} ${CONAN_FRAMEWORKS${SUFFIX}})
|
||||
set(CONAN_FRAMEWORK_DIRS${SUFFIX} ${CONAN_FRAMEWORK_DIRS${SUFFIX}_RELWITHDEBINFO} ${CONAN_FRAMEWORK_DIRS${SUFFIX}})
|
||||
elseif(${_BTYPE} MATCHES "MinSizeRel|_MINSIZEREL")
|
||||
set(CONAN_FRAMEWORKS${SUFFIX} ${CONAN_FRAMEWORKS${SUFFIX}_MINSIZEREL} ${CONAN_FRAMEWORKS${SUFFIX}})
|
||||
set(CONAN_FRAMEWORK_DIRS${SUFFIX} ${CONAN_FRAMEWORK_DIRS${SUFFIX}_MINSIZEREL} ${CONAN_FRAMEWORK_DIRS${SUFFIX}})
|
||||
endif()
|
||||
endif()
|
||||
foreach(_FRAMEWORK ${FRAMEWORKS})
|
||||
# https://cmake.org/pipermail/cmake-developers/2017-August/030199.html
|
||||
find_library(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND NAMES ${_FRAMEWORK} PATHS ${CONAN_FRAMEWORK_DIRS${SUFFIX}} CMAKE_FIND_ROOT_PATH_BOTH)
|
||||
if(CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND)
|
||||
list(APPEND ${FRAMEWORKS_FOUND} ${CONAN_FRAMEWORK_${_FRAMEWORK}_FOUND})
|
||||
else()
|
||||
message(FATAL_ERROR "Framework library ${_FRAMEWORK} not found in paths: ${CONAN_FRAMEWORK_DIRS${SUFFIX}}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
#################
|
||||
### BOOST
|
||||
#################
|
||||
set(CONAN_BOOST_ROOT "C:/.conan/029ec3/1")
|
||||
set(CONAN_INCLUDE_DIRS_BOOST "C:/.conan/029ec3/1/include")
|
||||
set(CONAN_LIB_DIRS_BOOST "C:/.conan/029ec3/1/lib")
|
||||
set(CONAN_BIN_DIRS_BOOST )
|
||||
set(CONAN_RES_DIRS_BOOST )
|
||||
set(CONAN_SRC_DIRS_BOOST )
|
||||
set(CONAN_BUILD_DIRS_BOOST )
|
||||
set(CONAN_FRAMEWORK_DIRS_BOOST )
|
||||
set(CONAN_LIBS_BOOST libboost_contract libboost_coroutine libboost_context libboost_graph libboost_iostreams libboost_json libboost_locale libboost_log_setup libboost_log libboost_math_c99 libboost_math_c99f libboost_math_c99l libboost_math_tr1 libboost_math_tr1f libboost_math_tr1l libboost_nowide libboost_program_options libboost_random libboost_regex libboost_stacktrace_noop libboost_stacktrace_windbg libboost_stacktrace_windbg_cached libboost_timer libboost_type_erasure libboost_thread libboost_chrono libboost_container libboost_date_time libboost_unit_test_framework libboost_prg_exec_monitor libboost_test_exec_monitor libboost_exception libboost_url libboost_wave libboost_filesystem libboost_atomic libboost_wserialization libboost_serialization)
|
||||
set(CONAN_PKG_LIBS_BOOST libboost_contract libboost_coroutine libboost_context libboost_graph libboost_iostreams libboost_json libboost_locale libboost_log_setup libboost_log libboost_math_c99 libboost_math_c99f libboost_math_c99l libboost_math_tr1 libboost_math_tr1f libboost_math_tr1l libboost_nowide libboost_program_options libboost_random libboost_regex libboost_stacktrace_noop libboost_stacktrace_windbg libboost_stacktrace_windbg_cached libboost_timer libboost_type_erasure libboost_thread libboost_chrono libboost_container libboost_date_time libboost_unit_test_framework libboost_prg_exec_monitor libboost_test_exec_monitor libboost_exception libboost_url libboost_wave libboost_filesystem libboost_atomic libboost_wserialization libboost_serialization)
|
||||
set(CONAN_SYSTEM_LIBS_BOOST ole32 dbgeng bcrypt ntdll shell32 Advapi32 user32)
|
||||
set(CONAN_FRAMEWORKS_BOOST )
|
||||
set(CONAN_FRAMEWORKS_FOUND_BOOST "") # Will be filled later
|
||||
set(CONAN_DEFINES_BOOST "-DBOOST_STACKTRACE_USE_NOOP"
|
||||
"-DBOOST_STACKTRACE_USE_WINDBG"
|
||||
"-DBOOST_STACKTRACE_USE_WINDBG_CACHED"
|
||||
"-DBOOST_ALL_NO_LIB")
|
||||
set(CONAN_BUILD_MODULES_PATHS_BOOST )
|
||||
# COMPILE_DEFINITIONS are equal to CONAN_DEFINES without -D, for targets
|
||||
set(CONAN_COMPILE_DEFINITIONS_BOOST "BOOST_STACKTRACE_USE_NOOP"
|
||||
"BOOST_STACKTRACE_USE_WINDBG"
|
||||
"BOOST_STACKTRACE_USE_WINDBG_CACHED"
|
||||
"BOOST_ALL_NO_LIB")
|
||||
|
||||
set(CONAN_C_FLAGS_BOOST "")
|
||||
set(CONAN_CXX_FLAGS_BOOST "")
|
||||
set(CONAN_SHARED_LINKER_FLAGS_BOOST "")
|
||||
set(CONAN_EXE_LINKER_FLAGS_BOOST "")
|
||||
|
||||
# For modern cmake targets we use the list variables (separated with ;)
|
||||
set(CONAN_C_FLAGS_BOOST_LIST "")
|
||||
set(CONAN_CXX_FLAGS_BOOST_LIST "")
|
||||
set(CONAN_SHARED_LINKER_FLAGS_BOOST_LIST "")
|
||||
set(CONAN_EXE_LINKER_FLAGS_BOOST_LIST "")
|
||||
|
||||
# Apple Frameworks
|
||||
conan_find_apple_frameworks(CONAN_FRAMEWORKS_FOUND_BOOST "${CONAN_FRAMEWORKS_BOOST}" "_BOOST" "")
|
||||
# Append to aggregated values variable
|
||||
set(CONAN_LIBS_BOOST ${CONAN_PKG_LIBS_BOOST} ${CONAN_SYSTEM_LIBS_BOOST} ${CONAN_FRAMEWORKS_FOUND_BOOST})
|
||||
|
||||
|
||||
#################
|
||||
### ZLIB
|
||||
#################
|
||||
set(CONAN_ZLIB_ROOT "C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b")
|
||||
set(CONAN_INCLUDE_DIRS_ZLIB "C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include")
|
||||
set(CONAN_LIB_DIRS_ZLIB "C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/lib")
|
||||
set(CONAN_BIN_DIRS_ZLIB )
|
||||
set(CONAN_RES_DIRS_ZLIB )
|
||||
set(CONAN_SRC_DIRS_ZLIB )
|
||||
set(CONAN_BUILD_DIRS_ZLIB "C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/")
|
||||
set(CONAN_FRAMEWORK_DIRS_ZLIB )
|
||||
set(CONAN_LIBS_ZLIB zlib)
|
||||
set(CONAN_PKG_LIBS_ZLIB zlib)
|
||||
set(CONAN_SYSTEM_LIBS_ZLIB )
|
||||
set(CONAN_FRAMEWORKS_ZLIB )
|
||||
set(CONAN_FRAMEWORKS_FOUND_ZLIB "") # Will be filled later
|
||||
set(CONAN_DEFINES_ZLIB )
|
||||
set(CONAN_BUILD_MODULES_PATHS_ZLIB )
|
||||
# COMPILE_DEFINITIONS are equal to CONAN_DEFINES without -D, for targets
|
||||
set(CONAN_COMPILE_DEFINITIONS_ZLIB )
|
||||
|
||||
set(CONAN_C_FLAGS_ZLIB "")
|
||||
set(CONAN_CXX_FLAGS_ZLIB "")
|
||||
set(CONAN_SHARED_LINKER_FLAGS_ZLIB "")
|
||||
set(CONAN_EXE_LINKER_FLAGS_ZLIB "")
|
||||
|
||||
# For modern cmake targets we use the list variables (separated with ;)
|
||||
set(CONAN_C_FLAGS_ZLIB_LIST "")
|
||||
set(CONAN_CXX_FLAGS_ZLIB_LIST "")
|
||||
set(CONAN_SHARED_LINKER_FLAGS_ZLIB_LIST "")
|
||||
set(CONAN_EXE_LINKER_FLAGS_ZLIB_LIST "")
|
||||
|
||||
# Apple Frameworks
|
||||
conan_find_apple_frameworks(CONAN_FRAMEWORKS_FOUND_ZLIB "${CONAN_FRAMEWORKS_ZLIB}" "_ZLIB" "")
|
||||
# Append to aggregated values variable
|
||||
set(CONAN_LIBS_ZLIB ${CONAN_PKG_LIBS_ZLIB} ${CONAN_SYSTEM_LIBS_ZLIB} ${CONAN_FRAMEWORKS_FOUND_ZLIB})
|
||||
|
||||
|
||||
#################
|
||||
### BZIP2
|
||||
#################
|
||||
set(CONAN_BZIP2_ROOT "C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201")
|
||||
set(CONAN_INCLUDE_DIRS_BZIP2 "C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/include")
|
||||
set(CONAN_LIB_DIRS_BZIP2 "C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/lib")
|
||||
set(CONAN_BIN_DIRS_BZIP2 "C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/bin")
|
||||
set(CONAN_RES_DIRS_BZIP2 )
|
||||
set(CONAN_SRC_DIRS_BZIP2 )
|
||||
set(CONAN_BUILD_DIRS_BZIP2 "C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/")
|
||||
set(CONAN_FRAMEWORK_DIRS_BZIP2 )
|
||||
set(CONAN_LIBS_BZIP2 bz2)
|
||||
set(CONAN_PKG_LIBS_BZIP2 bz2)
|
||||
set(CONAN_SYSTEM_LIBS_BZIP2 )
|
||||
set(CONAN_FRAMEWORKS_BZIP2 )
|
||||
set(CONAN_FRAMEWORKS_FOUND_BZIP2 "") # Will be filled later
|
||||
set(CONAN_DEFINES_BZIP2 )
|
||||
set(CONAN_BUILD_MODULES_PATHS_BZIP2 )
|
||||
# COMPILE_DEFINITIONS are equal to CONAN_DEFINES without -D, for targets
|
||||
set(CONAN_COMPILE_DEFINITIONS_BZIP2 )
|
||||
|
||||
set(CONAN_C_FLAGS_BZIP2 "")
|
||||
set(CONAN_CXX_FLAGS_BZIP2 "")
|
||||
set(CONAN_SHARED_LINKER_FLAGS_BZIP2 "")
|
||||
set(CONAN_EXE_LINKER_FLAGS_BZIP2 "")
|
||||
|
||||
# For modern cmake targets we use the list variables (separated with ;)
|
||||
set(CONAN_C_FLAGS_BZIP2_LIST "")
|
||||
set(CONAN_CXX_FLAGS_BZIP2_LIST "")
|
||||
set(CONAN_SHARED_LINKER_FLAGS_BZIP2_LIST "")
|
||||
set(CONAN_EXE_LINKER_FLAGS_BZIP2_LIST "")
|
||||
|
||||
# Apple Frameworks
|
||||
conan_find_apple_frameworks(CONAN_FRAMEWORKS_FOUND_BZIP2 "${CONAN_FRAMEWORKS_BZIP2}" "_BZIP2" "")
|
||||
# Append to aggregated values variable
|
||||
set(CONAN_LIBS_BZIP2 ${CONAN_PKG_LIBS_BZIP2} ${CONAN_SYSTEM_LIBS_BZIP2} ${CONAN_FRAMEWORKS_FOUND_BZIP2})
|
||||
|
||||
|
||||
### Definition of global aggregated variables ###
|
||||
|
||||
set(CONAN_PACKAGE_NAME None)
|
||||
set(CONAN_PACKAGE_VERSION None)
|
||||
|
||||
set(CONAN_SETTINGS_ARCH "x86_64")
|
||||
set(CONAN_SETTINGS_ARCH_BUILD "x86_64")
|
||||
set(CONAN_SETTINGS_BUILD_TYPE "Release")
|
||||
set(CONAN_SETTINGS_COMPILER "Visual Studio")
|
||||
set(CONAN_SETTINGS_COMPILER_RUNTIME "MD")
|
||||
set(CONAN_SETTINGS_COMPILER_VERSION "17")
|
||||
set(CONAN_SETTINGS_OS "Windows")
|
||||
set(CONAN_SETTINGS_OS_BUILD "Windows")
|
||||
|
||||
set(CONAN_DEPENDENCIES boost zlib bzip2)
|
||||
# Storing original command line args (CMake helper) flags
|
||||
set(CONAN_CMD_CXX_FLAGS ${CONAN_CXX_FLAGS})
|
||||
|
||||
set(CONAN_CMD_SHARED_LINKER_FLAGS ${CONAN_SHARED_LINKER_FLAGS})
|
||||
set(CONAN_CMD_C_FLAGS ${CONAN_C_FLAGS})
|
||||
# Defining accumulated conan variables for all deps
|
||||
|
||||
set(CONAN_INCLUDE_DIRS "C:/.conan/029ec3/1/include"
|
||||
"C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include"
|
||||
"C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/include" ${CONAN_INCLUDE_DIRS})
|
||||
set(CONAN_LIB_DIRS "C:/.conan/029ec3/1/lib"
|
||||
"C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/lib"
|
||||
"C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/lib" ${CONAN_LIB_DIRS})
|
||||
set(CONAN_BIN_DIRS "C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/bin" ${CONAN_BIN_DIRS})
|
||||
set(CONAN_RES_DIRS ${CONAN_RES_DIRS})
|
||||
set(CONAN_FRAMEWORK_DIRS ${CONAN_FRAMEWORK_DIRS})
|
||||
set(CONAN_LIBS libboost_contract libboost_coroutine libboost_context libboost_graph libboost_iostreams libboost_json libboost_locale libboost_log_setup libboost_log libboost_math_c99 libboost_math_c99f libboost_math_c99l libboost_math_tr1 libboost_math_tr1f libboost_math_tr1l libboost_nowide libboost_program_options libboost_random libboost_regex libboost_stacktrace_noop libboost_stacktrace_windbg libboost_stacktrace_windbg_cached libboost_timer libboost_type_erasure libboost_thread libboost_chrono libboost_container libboost_date_time libboost_unit_test_framework libboost_prg_exec_monitor libboost_test_exec_monitor libboost_exception libboost_url libboost_wave libboost_filesystem libboost_atomic libboost_wserialization libboost_serialization zlib bz2 ${CONAN_LIBS})
|
||||
set(CONAN_PKG_LIBS libboost_contract libboost_coroutine libboost_context libboost_graph libboost_iostreams libboost_json libboost_locale libboost_log_setup libboost_log libboost_math_c99 libboost_math_c99f libboost_math_c99l libboost_math_tr1 libboost_math_tr1f libboost_math_tr1l libboost_nowide libboost_program_options libboost_random libboost_regex libboost_stacktrace_noop libboost_stacktrace_windbg libboost_stacktrace_windbg_cached libboost_timer libboost_type_erasure libboost_thread libboost_chrono libboost_container libboost_date_time libboost_unit_test_framework libboost_prg_exec_monitor libboost_test_exec_monitor libboost_exception libboost_url libboost_wave libboost_filesystem libboost_atomic libboost_wserialization libboost_serialization zlib bz2 ${CONAN_PKG_LIBS})
|
||||
set(CONAN_SYSTEM_LIBS ole32 dbgeng bcrypt ntdll shell32 Advapi32 user32 ${CONAN_SYSTEM_LIBS})
|
||||
set(CONAN_FRAMEWORKS ${CONAN_FRAMEWORKS})
|
||||
set(CONAN_FRAMEWORKS_FOUND "") # Will be filled later
|
||||
set(CONAN_DEFINES "-DBOOST_STACKTRACE_USE_NOOP"
|
||||
"-DBOOST_STACKTRACE_USE_WINDBG"
|
||||
"-DBOOST_STACKTRACE_USE_WINDBG_CACHED"
|
||||
"-DBOOST_ALL_NO_LIB" ${CONAN_DEFINES})
|
||||
set(CONAN_BUILD_MODULES_PATHS ${CONAN_BUILD_MODULES_PATHS})
|
||||
set(CONAN_CMAKE_MODULE_PATH "C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/"
|
||||
"C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/" ${CONAN_CMAKE_MODULE_PATH})
|
||||
|
||||
set(CONAN_CXX_FLAGS " ${CONAN_CXX_FLAGS}")
|
||||
set(CONAN_SHARED_LINKER_FLAGS " ${CONAN_SHARED_LINKER_FLAGS}")
|
||||
set(CONAN_EXE_LINKER_FLAGS " ${CONAN_EXE_LINKER_FLAGS}")
|
||||
set(CONAN_C_FLAGS " ${CONAN_C_FLAGS}")
|
||||
|
||||
# Apple Frameworks
|
||||
conan_find_apple_frameworks(CONAN_FRAMEWORKS_FOUND "${CONAN_FRAMEWORKS}" "" "")
|
||||
# Append to aggregated values variable: Use CONAN_LIBS instead of CONAN_PKG_LIBS to include user appended vars
|
||||
set(CONAN_LIBS ${CONAN_LIBS} ${CONAN_SYSTEM_LIBS} ${CONAN_FRAMEWORKS_FOUND})
|
||||
|
||||
|
||||
### Definition of macros and functions ###
|
||||
|
||||
macro(conan_define_targets)
|
||||
if(${CMAKE_VERSION} VERSION_LESS "3.1.2")
|
||||
message(FATAL_ERROR "TARGETS not supported by your CMake version!")
|
||||
endif() # CMAKE > 3.x
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CONAN_CMD_CXX_FLAGS}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CONAN_CMD_C_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${CONAN_CMD_SHARED_LINKER_FLAGS}")
|
||||
|
||||
|
||||
set(_CONAN_PKG_LIBS_BOOST_DEPENDENCIES "${CONAN_SYSTEM_LIBS_BOOST} ${CONAN_FRAMEWORKS_FOUND_BOOST} CONAN_PKG::zlib CONAN_PKG::bzip2")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BOOST_DEPENDENCIES "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BOOST}" "${CONAN_LIB_DIRS_BOOST}"
|
||||
CONAN_PACKAGE_TARGETS_BOOST "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES}"
|
||||
"" boost)
|
||||
set(_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_DEBUG "${CONAN_SYSTEM_LIBS_BOOST_DEBUG} ${CONAN_FRAMEWORKS_FOUND_BOOST_DEBUG} CONAN_PKG::zlib CONAN_PKG::bzip2")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BOOST_DEPENDENCIES_DEBUG "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_DEBUG}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BOOST_DEBUG}" "${CONAN_LIB_DIRS_BOOST_DEBUG}"
|
||||
CONAN_PACKAGE_TARGETS_BOOST_DEBUG "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_DEBUG}"
|
||||
"debug" boost)
|
||||
set(_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELEASE "${CONAN_SYSTEM_LIBS_BOOST_RELEASE} ${CONAN_FRAMEWORKS_FOUND_BOOST_RELEASE} CONAN_PKG::zlib CONAN_PKG::bzip2")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELEASE "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELEASE}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BOOST_RELEASE}" "${CONAN_LIB_DIRS_BOOST_RELEASE}"
|
||||
CONAN_PACKAGE_TARGETS_BOOST_RELEASE "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELEASE}"
|
||||
"release" boost)
|
||||
set(_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELWITHDEBINFO "${CONAN_SYSTEM_LIBS_BOOST_RELWITHDEBINFO} ${CONAN_FRAMEWORKS_FOUND_BOOST_RELWITHDEBINFO} CONAN_PKG::zlib CONAN_PKG::bzip2")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELWITHDEBINFO "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELWITHDEBINFO}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BOOST_RELWITHDEBINFO}" "${CONAN_LIB_DIRS_BOOST_RELWITHDEBINFO}"
|
||||
CONAN_PACKAGE_TARGETS_BOOST_RELWITHDEBINFO "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELWITHDEBINFO}"
|
||||
"relwithdebinfo" boost)
|
||||
set(_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_MINSIZEREL "${CONAN_SYSTEM_LIBS_BOOST_MINSIZEREL} ${CONAN_FRAMEWORKS_FOUND_BOOST_MINSIZEREL} CONAN_PKG::zlib CONAN_PKG::bzip2")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BOOST_DEPENDENCIES_MINSIZEREL "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_MINSIZEREL}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BOOST_MINSIZEREL}" "${CONAN_LIB_DIRS_BOOST_MINSIZEREL}"
|
||||
CONAN_PACKAGE_TARGETS_BOOST_MINSIZEREL "${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_MINSIZEREL}"
|
||||
"minsizerel" boost)
|
||||
|
||||
add_library(CONAN_PKG::boost INTERFACE IMPORTED)
|
||||
|
||||
# Property INTERFACE_LINK_FLAGS do not work, necessary to add to INTERFACE_LINK_LIBRARIES
|
||||
set_property(TARGET CONAN_PKG::boost PROPERTY INTERFACE_LINK_LIBRARIES ${CONAN_PACKAGE_TARGETS_BOOST} ${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BOOST_LIST}>
|
||||
|
||||
$<$<CONFIG:Release>:${CONAN_PACKAGE_TARGETS_BOOST_RELEASE} ${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELEASE}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_RELEASE_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_RELEASE_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BOOST_RELEASE_LIST}>>
|
||||
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_PACKAGE_TARGETS_BOOST_RELWITHDEBINFO} ${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_RELWITHDEBINFO}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_RELWITHDEBINFO_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_RELWITHDEBINFO_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BOOST_RELWITHDEBINFO_LIST}>>
|
||||
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_PACKAGE_TARGETS_BOOST_MINSIZEREL} ${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_MINSIZEREL}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_MINSIZEREL_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_MINSIZEREL_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BOOST_MINSIZEREL_LIST}>>
|
||||
|
||||
$<$<CONFIG:Debug>:${CONAN_PACKAGE_TARGETS_BOOST_DEBUG} ${_CONAN_PKG_LIBS_BOOST_DEPENDENCIES_DEBUG}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_DEBUG_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BOOST_DEBUG_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BOOST_DEBUG_LIST}>>)
|
||||
set_property(TARGET CONAN_PKG::boost PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CONAN_INCLUDE_DIRS_BOOST}
|
||||
$<$<CONFIG:Release>:${CONAN_INCLUDE_DIRS_BOOST_RELEASE}>
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_INCLUDE_DIRS_BOOST_RELWITHDEBINFO}>
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_INCLUDE_DIRS_BOOST_MINSIZEREL}>
|
||||
$<$<CONFIG:Debug>:${CONAN_INCLUDE_DIRS_BOOST_DEBUG}>)
|
||||
set_property(TARGET CONAN_PKG::boost PROPERTY INTERFACE_COMPILE_DEFINITIONS ${CONAN_COMPILE_DEFINITIONS_BOOST}
|
||||
$<$<CONFIG:Release>:${CONAN_COMPILE_DEFINITIONS_BOOST_RELEASE}>
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_COMPILE_DEFINITIONS_BOOST_RELWITHDEBINFO}>
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_COMPILE_DEFINITIONS_BOOST_MINSIZEREL}>
|
||||
$<$<CONFIG:Debug>:${CONAN_COMPILE_DEFINITIONS_BOOST_DEBUG}>)
|
||||
set_property(TARGET CONAN_PKG::boost PROPERTY INTERFACE_COMPILE_OPTIONS ${CONAN_C_FLAGS_BOOST_LIST} ${CONAN_CXX_FLAGS_BOOST_LIST}
|
||||
$<$<CONFIG:Release>:${CONAN_C_FLAGS_BOOST_RELEASE_LIST} ${CONAN_CXX_FLAGS_BOOST_RELEASE_LIST}>
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_C_FLAGS_BOOST_RELWITHDEBINFO_LIST} ${CONAN_CXX_FLAGS_BOOST_RELWITHDEBINFO_LIST}>
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_C_FLAGS_BOOST_MINSIZEREL_LIST} ${CONAN_CXX_FLAGS_BOOST_MINSIZEREL_LIST}>
|
||||
$<$<CONFIG:Debug>:${CONAN_C_FLAGS_BOOST_DEBUG_LIST} ${CONAN_CXX_FLAGS_BOOST_DEBUG_LIST}>)
|
||||
|
||||
|
||||
set(_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES "${CONAN_SYSTEM_LIBS_ZLIB} ${CONAN_FRAMEWORKS_FOUND_ZLIB} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_ZLIB_DEPENDENCIES "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_ZLIB}" "${CONAN_LIB_DIRS_ZLIB}"
|
||||
CONAN_PACKAGE_TARGETS_ZLIB "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES}"
|
||||
"" zlib)
|
||||
set(_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_DEBUG "${CONAN_SYSTEM_LIBS_ZLIB_DEBUG} ${CONAN_FRAMEWORKS_FOUND_ZLIB_DEBUG} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_DEBUG "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_DEBUG}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_ZLIB_DEBUG}" "${CONAN_LIB_DIRS_ZLIB_DEBUG}"
|
||||
CONAN_PACKAGE_TARGETS_ZLIB_DEBUG "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_DEBUG}"
|
||||
"debug" zlib)
|
||||
set(_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELEASE "${CONAN_SYSTEM_LIBS_ZLIB_RELEASE} ${CONAN_FRAMEWORKS_FOUND_ZLIB_RELEASE} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELEASE "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELEASE}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_ZLIB_RELEASE}" "${CONAN_LIB_DIRS_ZLIB_RELEASE}"
|
||||
CONAN_PACKAGE_TARGETS_ZLIB_RELEASE "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELEASE}"
|
||||
"release" zlib)
|
||||
set(_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELWITHDEBINFO "${CONAN_SYSTEM_LIBS_ZLIB_RELWITHDEBINFO} ${CONAN_FRAMEWORKS_FOUND_ZLIB_RELWITHDEBINFO} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELWITHDEBINFO "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELWITHDEBINFO}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_ZLIB_RELWITHDEBINFO}" "${CONAN_LIB_DIRS_ZLIB_RELWITHDEBINFO}"
|
||||
CONAN_PACKAGE_TARGETS_ZLIB_RELWITHDEBINFO "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELWITHDEBINFO}"
|
||||
"relwithdebinfo" zlib)
|
||||
set(_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_MINSIZEREL "${CONAN_SYSTEM_LIBS_ZLIB_MINSIZEREL} ${CONAN_FRAMEWORKS_FOUND_ZLIB_MINSIZEREL} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_MINSIZEREL "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_MINSIZEREL}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_ZLIB_MINSIZEREL}" "${CONAN_LIB_DIRS_ZLIB_MINSIZEREL}"
|
||||
CONAN_PACKAGE_TARGETS_ZLIB_MINSIZEREL "${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_MINSIZEREL}"
|
||||
"minsizerel" zlib)
|
||||
|
||||
add_library(CONAN_PKG::zlib INTERFACE IMPORTED)
|
||||
|
||||
# Property INTERFACE_LINK_FLAGS do not work, necessary to add to INTERFACE_LINK_LIBRARIES
|
||||
set_property(TARGET CONAN_PKG::zlib PROPERTY INTERFACE_LINK_LIBRARIES ${CONAN_PACKAGE_TARGETS_ZLIB} ${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_ZLIB_LIST}>
|
||||
|
||||
$<$<CONFIG:Release>:${CONAN_PACKAGE_TARGETS_ZLIB_RELEASE} ${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELEASE}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_RELEASE_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_RELEASE_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_ZLIB_RELEASE_LIST}>>
|
||||
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_PACKAGE_TARGETS_ZLIB_RELWITHDEBINFO} ${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_RELWITHDEBINFO}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_RELWITHDEBINFO_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_RELWITHDEBINFO_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_ZLIB_RELWITHDEBINFO_LIST}>>
|
||||
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_PACKAGE_TARGETS_ZLIB_MINSIZEREL} ${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_MINSIZEREL}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_MINSIZEREL_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_MINSIZEREL_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_ZLIB_MINSIZEREL_LIST}>>
|
||||
|
||||
$<$<CONFIG:Debug>:${CONAN_PACKAGE_TARGETS_ZLIB_DEBUG} ${_CONAN_PKG_LIBS_ZLIB_DEPENDENCIES_DEBUG}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_DEBUG_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_ZLIB_DEBUG_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_ZLIB_DEBUG_LIST}>>)
|
||||
set_property(TARGET CONAN_PKG::zlib PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CONAN_INCLUDE_DIRS_ZLIB}
|
||||
$<$<CONFIG:Release>:${CONAN_INCLUDE_DIRS_ZLIB_RELEASE}>
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_INCLUDE_DIRS_ZLIB_RELWITHDEBINFO}>
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_INCLUDE_DIRS_ZLIB_MINSIZEREL}>
|
||||
$<$<CONFIG:Debug>:${CONAN_INCLUDE_DIRS_ZLIB_DEBUG}>)
|
||||
set_property(TARGET CONAN_PKG::zlib PROPERTY INTERFACE_COMPILE_DEFINITIONS ${CONAN_COMPILE_DEFINITIONS_ZLIB}
|
||||
$<$<CONFIG:Release>:${CONAN_COMPILE_DEFINITIONS_ZLIB_RELEASE}>
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_COMPILE_DEFINITIONS_ZLIB_RELWITHDEBINFO}>
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_COMPILE_DEFINITIONS_ZLIB_MINSIZEREL}>
|
||||
$<$<CONFIG:Debug>:${CONAN_COMPILE_DEFINITIONS_ZLIB_DEBUG}>)
|
||||
set_property(TARGET CONAN_PKG::zlib PROPERTY INTERFACE_COMPILE_OPTIONS ${CONAN_C_FLAGS_ZLIB_LIST} ${CONAN_CXX_FLAGS_ZLIB_LIST}
|
||||
$<$<CONFIG:Release>:${CONAN_C_FLAGS_ZLIB_RELEASE_LIST} ${CONAN_CXX_FLAGS_ZLIB_RELEASE_LIST}>
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_C_FLAGS_ZLIB_RELWITHDEBINFO_LIST} ${CONAN_CXX_FLAGS_ZLIB_RELWITHDEBINFO_LIST}>
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_C_FLAGS_ZLIB_MINSIZEREL_LIST} ${CONAN_CXX_FLAGS_ZLIB_MINSIZEREL_LIST}>
|
||||
$<$<CONFIG:Debug>:${CONAN_C_FLAGS_ZLIB_DEBUG_LIST} ${CONAN_CXX_FLAGS_ZLIB_DEBUG_LIST}>)
|
||||
|
||||
|
||||
set(_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES "${CONAN_SYSTEM_LIBS_BZIP2} ${CONAN_FRAMEWORKS_FOUND_BZIP2} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BZIP2_DEPENDENCIES "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BZIP2}" "${CONAN_LIB_DIRS_BZIP2}"
|
||||
CONAN_PACKAGE_TARGETS_BZIP2 "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES}"
|
||||
"" bzip2)
|
||||
set(_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_DEBUG "${CONAN_SYSTEM_LIBS_BZIP2_DEBUG} ${CONAN_FRAMEWORKS_FOUND_BZIP2_DEBUG} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_DEBUG "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_DEBUG}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BZIP2_DEBUG}" "${CONAN_LIB_DIRS_BZIP2_DEBUG}"
|
||||
CONAN_PACKAGE_TARGETS_BZIP2_DEBUG "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_DEBUG}"
|
||||
"debug" bzip2)
|
||||
set(_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELEASE "${CONAN_SYSTEM_LIBS_BZIP2_RELEASE} ${CONAN_FRAMEWORKS_FOUND_BZIP2_RELEASE} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELEASE "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELEASE}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BZIP2_RELEASE}" "${CONAN_LIB_DIRS_BZIP2_RELEASE}"
|
||||
CONAN_PACKAGE_TARGETS_BZIP2_RELEASE "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELEASE}"
|
||||
"release" bzip2)
|
||||
set(_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELWITHDEBINFO "${CONAN_SYSTEM_LIBS_BZIP2_RELWITHDEBINFO} ${CONAN_FRAMEWORKS_FOUND_BZIP2_RELWITHDEBINFO} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELWITHDEBINFO "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELWITHDEBINFO}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BZIP2_RELWITHDEBINFO}" "${CONAN_LIB_DIRS_BZIP2_RELWITHDEBINFO}"
|
||||
CONAN_PACKAGE_TARGETS_BZIP2_RELWITHDEBINFO "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELWITHDEBINFO}"
|
||||
"relwithdebinfo" bzip2)
|
||||
set(_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_MINSIZEREL "${CONAN_SYSTEM_LIBS_BZIP2_MINSIZEREL} ${CONAN_FRAMEWORKS_FOUND_BZIP2_MINSIZEREL} ")
|
||||
string(REPLACE " " ";" _CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_MINSIZEREL "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_MINSIZEREL}")
|
||||
conan_package_library_targets("${CONAN_PKG_LIBS_BZIP2_MINSIZEREL}" "${CONAN_LIB_DIRS_BZIP2_MINSIZEREL}"
|
||||
CONAN_PACKAGE_TARGETS_BZIP2_MINSIZEREL "${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_MINSIZEREL}"
|
||||
"minsizerel" bzip2)
|
||||
|
||||
add_library(CONAN_PKG::bzip2 INTERFACE IMPORTED)
|
||||
|
||||
# Property INTERFACE_LINK_FLAGS do not work, necessary to add to INTERFACE_LINK_LIBRARIES
|
||||
set_property(TARGET CONAN_PKG::bzip2 PROPERTY INTERFACE_LINK_LIBRARIES ${CONAN_PACKAGE_TARGETS_BZIP2} ${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BZIP2_LIST}>
|
||||
|
||||
$<$<CONFIG:Release>:${CONAN_PACKAGE_TARGETS_BZIP2_RELEASE} ${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELEASE}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_RELEASE_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_RELEASE_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BZIP2_RELEASE_LIST}>>
|
||||
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_PACKAGE_TARGETS_BZIP2_RELWITHDEBINFO} ${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_RELWITHDEBINFO}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_RELWITHDEBINFO_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_RELWITHDEBINFO_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BZIP2_RELWITHDEBINFO_LIST}>>
|
||||
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_PACKAGE_TARGETS_BZIP2_MINSIZEREL} ${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_MINSIZEREL}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_MINSIZEREL_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_MINSIZEREL_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BZIP2_MINSIZEREL_LIST}>>
|
||||
|
||||
$<$<CONFIG:Debug>:${CONAN_PACKAGE_TARGETS_BZIP2_DEBUG} ${_CONAN_PKG_LIBS_BZIP2_DEPENDENCIES_DEBUG}
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,SHARED_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_DEBUG_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,MODULE_LIBRARY>:${CONAN_SHARED_LINKER_FLAGS_BZIP2_DEBUG_LIST}>
|
||||
$<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:${CONAN_EXE_LINKER_FLAGS_BZIP2_DEBUG_LIST}>>)
|
||||
set_property(TARGET CONAN_PKG::bzip2 PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CONAN_INCLUDE_DIRS_BZIP2}
|
||||
$<$<CONFIG:Release>:${CONAN_INCLUDE_DIRS_BZIP2_RELEASE}>
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_INCLUDE_DIRS_BZIP2_RELWITHDEBINFO}>
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_INCLUDE_DIRS_BZIP2_MINSIZEREL}>
|
||||
$<$<CONFIG:Debug>:${CONAN_INCLUDE_DIRS_BZIP2_DEBUG}>)
|
||||
set_property(TARGET CONAN_PKG::bzip2 PROPERTY INTERFACE_COMPILE_DEFINITIONS ${CONAN_COMPILE_DEFINITIONS_BZIP2}
|
||||
$<$<CONFIG:Release>:${CONAN_COMPILE_DEFINITIONS_BZIP2_RELEASE}>
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_COMPILE_DEFINITIONS_BZIP2_RELWITHDEBINFO}>
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_COMPILE_DEFINITIONS_BZIP2_MINSIZEREL}>
|
||||
$<$<CONFIG:Debug>:${CONAN_COMPILE_DEFINITIONS_BZIP2_DEBUG}>)
|
||||
set_property(TARGET CONAN_PKG::bzip2 PROPERTY INTERFACE_COMPILE_OPTIONS ${CONAN_C_FLAGS_BZIP2_LIST} ${CONAN_CXX_FLAGS_BZIP2_LIST}
|
||||
$<$<CONFIG:Release>:${CONAN_C_FLAGS_BZIP2_RELEASE_LIST} ${CONAN_CXX_FLAGS_BZIP2_RELEASE_LIST}>
|
||||
$<$<CONFIG:RelWithDebInfo>:${CONAN_C_FLAGS_BZIP2_RELWITHDEBINFO_LIST} ${CONAN_CXX_FLAGS_BZIP2_RELWITHDEBINFO_LIST}>
|
||||
$<$<CONFIG:MinSizeRel>:${CONAN_C_FLAGS_BZIP2_MINSIZEREL_LIST} ${CONAN_CXX_FLAGS_BZIP2_MINSIZEREL_LIST}>
|
||||
$<$<CONFIG:Debug>:${CONAN_C_FLAGS_BZIP2_DEBUG_LIST} ${CONAN_CXX_FLAGS_BZIP2_DEBUG_LIST}>)
|
||||
|
||||
set(CONAN_TARGETS CONAN_PKG::boost CONAN_PKG::zlib CONAN_PKG::bzip2)
|
||||
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_basic_setup)
|
||||
set(options TARGETS NO_OUTPUT_DIRS SKIP_RPATH KEEP_RPATHS SKIP_STD SKIP_FPIC)
|
||||
cmake_parse_arguments(ARGUMENTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||
|
||||
if(CONAN_EXPORTED)
|
||||
conan_message(STATUS "Conan: called by CMake conan helper")
|
||||
endif()
|
||||
|
||||
if(CONAN_IN_LOCAL_CACHE)
|
||||
conan_message(STATUS "Conan: called inside local cache")
|
||||
endif()
|
||||
|
||||
if(NOT ARGUMENTS_NO_OUTPUT_DIRS)
|
||||
conan_message(STATUS "Conan: Adjusting output directories")
|
||||
conan_output_dirs_setup()
|
||||
endif()
|
||||
|
||||
if(NOT ARGUMENTS_TARGETS)
|
||||
conan_message(STATUS "Conan: Using cmake global configuration")
|
||||
conan_global_flags()
|
||||
else()
|
||||
conan_message(STATUS "Conan: Using cmake targets configuration")
|
||||
conan_define_targets()
|
||||
endif()
|
||||
|
||||
if(ARGUMENTS_SKIP_RPATH)
|
||||
# Change by "DEPRECATION" or "SEND_ERROR" when we are ready
|
||||
conan_message(WARNING "Conan: SKIP_RPATH is deprecated, it has been renamed to KEEP_RPATHS")
|
||||
endif()
|
||||
|
||||
if(NOT ARGUMENTS_SKIP_RPATH AND NOT ARGUMENTS_KEEP_RPATHS)
|
||||
# Parameter has renamed, but we keep the compatibility with old SKIP_RPATH
|
||||
conan_set_rpath()
|
||||
endif()
|
||||
|
||||
if(NOT ARGUMENTS_SKIP_STD)
|
||||
conan_set_std()
|
||||
endif()
|
||||
|
||||
if(NOT ARGUMENTS_SKIP_FPIC)
|
||||
conan_set_fpic()
|
||||
endif()
|
||||
|
||||
conan_check_compiler()
|
||||
conan_set_libcxx()
|
||||
conan_set_vs_runtime()
|
||||
conan_set_find_paths()
|
||||
conan_include_build_modules()
|
||||
conan_set_find_library_paths()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_set_find_paths)
|
||||
# CMAKE_MODULE_PATH does not have Debug/Release config, but there are variables
|
||||
# CONAN_CMAKE_MODULE_PATH_DEBUG to be used by the consumer
|
||||
# CMake can find findXXX.cmake files in the root of packages
|
||||
set(CMAKE_MODULE_PATH ${CONAN_CMAKE_MODULE_PATH} ${CMAKE_MODULE_PATH})
|
||||
|
||||
# Make find_package() to work
|
||||
set(CMAKE_PREFIX_PATH ${CONAN_CMAKE_MODULE_PATH} ${CMAKE_PREFIX_PATH})
|
||||
|
||||
# Set the find root path (cross build)
|
||||
set(CMAKE_FIND_ROOT_PATH ${CONAN_CMAKE_FIND_ROOT_PATH} ${CMAKE_FIND_ROOT_PATH})
|
||||
if(CONAN_CMAKE_FIND_ROOT_PATH_MODE_PROGRAM)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${CONAN_CMAKE_FIND_ROOT_PATH_MODE_PROGRAM})
|
||||
endif()
|
||||
if(CONAN_CMAKE_FIND_ROOT_PATH_MODE_LIBRARY)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ${CONAN_CMAKE_FIND_ROOT_PATH_MODE_LIBRARY})
|
||||
endif()
|
||||
if(CONAN_CMAKE_FIND_ROOT_PATH_MODE_INCLUDE)
|
||||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ${CONAN_CMAKE_FIND_ROOT_PATH_MODE_INCLUDE})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_set_find_library_paths)
|
||||
# CMAKE_INCLUDE_PATH, CMAKE_LIBRARY_PATH does not have Debug/Release config, but there are variables
|
||||
# CONAN_INCLUDE_DIRS_DEBUG/RELEASE CONAN_LIB_DIRS_DEBUG/RELEASE to be used by the consumer
|
||||
# For find_library
|
||||
set(CMAKE_INCLUDE_PATH ${CONAN_INCLUDE_DIRS} ${CMAKE_INCLUDE_PATH})
|
||||
set(CMAKE_LIBRARY_PATH ${CONAN_LIB_DIRS} ${CMAKE_LIBRARY_PATH})
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_set_vs_runtime)
|
||||
if(CONAN_LINK_RUNTIME)
|
||||
conan_get_policy(CMP0091 policy_0091)
|
||||
if(policy_0091 STREQUAL "NEW")
|
||||
if(CONAN_LINK_RUNTIME MATCHES "MTd")
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDebug")
|
||||
elseif(CONAN_LINK_RUNTIME MATCHES "MDd")
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDebugDLL")
|
||||
elseif(CONAN_LINK_RUNTIME MATCHES "MT")
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
|
||||
elseif(CONAN_LINK_RUNTIME MATCHES "MD")
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
|
||||
endif()
|
||||
else()
|
||||
foreach(flag CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||
CMAKE_C_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL)
|
||||
if(DEFINED ${flag})
|
||||
string(REPLACE "/MD" ${CONAN_LINK_RUNTIME} ${flag} "${${flag}}")
|
||||
endif()
|
||||
endforeach()
|
||||
foreach(flag CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG)
|
||||
if(DEFINED ${flag})
|
||||
string(REPLACE "/MDd" ${CONAN_LINK_RUNTIME} ${flag} "${${flag}}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_flags_setup)
|
||||
# Macro maintained for backwards compatibility
|
||||
conan_set_find_library_paths()
|
||||
conan_global_flags()
|
||||
conan_set_rpath()
|
||||
conan_set_vs_runtime()
|
||||
conan_set_libcxx()
|
||||
endmacro()
|
||||
|
||||
|
||||
function(conan_message MESSAGE_OUTPUT)
|
||||
if(NOT CONAN_CMAKE_SILENT_OUTPUT)
|
||||
message(${ARGV${0}})
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
function(conan_get_policy policy_id policy)
|
||||
if(POLICY "${policy_id}")
|
||||
cmake_policy(GET "${policy_id}" _policy)
|
||||
set(${policy} "${_policy}" PARENT_SCOPE)
|
||||
else()
|
||||
set(${policy} "" PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
function(conan_find_libraries_abs_path libraries package_libdir libraries_abs_path)
|
||||
foreach(_LIBRARY_NAME ${libraries})
|
||||
find_library(CONAN_FOUND_LIBRARY NAMES ${_LIBRARY_NAME} PATHS ${package_libdir}
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
if(CONAN_FOUND_LIBRARY)
|
||||
conan_message(STATUS "Library ${_LIBRARY_NAME} found ${CONAN_FOUND_LIBRARY}")
|
||||
set(CONAN_FULLPATH_LIBS ${CONAN_FULLPATH_LIBS} ${CONAN_FOUND_LIBRARY})
|
||||
else()
|
||||
conan_message(STATUS "Library ${_LIBRARY_NAME} not found in package, might be system one")
|
||||
set(CONAN_FULLPATH_LIBS ${CONAN_FULLPATH_LIBS} ${_LIBRARY_NAME})
|
||||
endif()
|
||||
unset(CONAN_FOUND_LIBRARY CACHE)
|
||||
endforeach()
|
||||
set(${libraries_abs_path} ${CONAN_FULLPATH_LIBS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
function(conan_package_library_targets libraries package_libdir libraries_abs_path deps build_type package_name)
|
||||
unset(_CONAN_ACTUAL_TARGETS CACHE)
|
||||
unset(_CONAN_FOUND_SYSTEM_LIBS CACHE)
|
||||
foreach(_LIBRARY_NAME ${libraries})
|
||||
find_library(CONAN_FOUND_LIBRARY NAMES ${_LIBRARY_NAME} PATHS ${package_libdir}
|
||||
NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH)
|
||||
if(CONAN_FOUND_LIBRARY)
|
||||
conan_message(STATUS "Library ${_LIBRARY_NAME} found ${CONAN_FOUND_LIBRARY}")
|
||||
set(_LIB_NAME CONAN_LIB::${package_name}_${_LIBRARY_NAME}${build_type})
|
||||
add_library(${_LIB_NAME} UNKNOWN IMPORTED)
|
||||
set_target_properties(${_LIB_NAME} PROPERTIES IMPORTED_LOCATION ${CONAN_FOUND_LIBRARY})
|
||||
set(CONAN_FULLPATH_LIBS ${CONAN_FULLPATH_LIBS} ${_LIB_NAME})
|
||||
set(_CONAN_ACTUAL_TARGETS ${_CONAN_ACTUAL_TARGETS} ${_LIB_NAME})
|
||||
else()
|
||||
conan_message(STATUS "Library ${_LIBRARY_NAME} not found in package, might be system one")
|
||||
set(CONAN_FULLPATH_LIBS ${CONAN_FULLPATH_LIBS} ${_LIBRARY_NAME})
|
||||
set(_CONAN_FOUND_SYSTEM_LIBS "${_CONAN_FOUND_SYSTEM_LIBS};${_LIBRARY_NAME}")
|
||||
endif()
|
||||
unset(CONAN_FOUND_LIBRARY CACHE)
|
||||
endforeach()
|
||||
|
||||
# Add all dependencies to all targets
|
||||
string(REPLACE " " ";" deps_list "${deps}")
|
||||
foreach(_CONAN_ACTUAL_TARGET ${_CONAN_ACTUAL_TARGETS})
|
||||
set_property(TARGET ${_CONAN_ACTUAL_TARGET} PROPERTY INTERFACE_LINK_LIBRARIES "${_CONAN_FOUND_SYSTEM_LIBS};${deps_list}")
|
||||
endforeach()
|
||||
|
||||
set(${libraries_abs_path} ${CONAN_FULLPATH_LIBS} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
|
||||
macro(conan_set_libcxx)
|
||||
if(DEFINED CONAN_LIBCXX)
|
||||
conan_message(STATUS "Conan: C++ stdlib: ${CONAN_LIBCXX}")
|
||||
if(CONAN_COMPILER STREQUAL "clang" OR CONAN_COMPILER STREQUAL "apple-clang")
|
||||
if(CONAN_LIBCXX STREQUAL "libstdc++" OR CONAN_LIBCXX STREQUAL "libstdc++11" )
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++")
|
||||
elseif(CONAN_LIBCXX STREQUAL "libc++")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
endif()
|
||||
endif()
|
||||
if(CONAN_COMPILER STREQUAL "sun-cc")
|
||||
if(CONAN_LIBCXX STREQUAL "libCstd")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=Cstd")
|
||||
elseif(CONAN_LIBCXX STREQUAL "libstdcxx")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stdcxx4")
|
||||
elseif(CONAN_LIBCXX STREQUAL "libstlport")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stlport4")
|
||||
elseif(CONAN_LIBCXX STREQUAL "libstdc++")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -library=stdcpp")
|
||||
endif()
|
||||
endif()
|
||||
if(CONAN_LIBCXX STREQUAL "libstdc++11")
|
||||
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1)
|
||||
elseif(CONAN_LIBCXX STREQUAL "libstdc++")
|
||||
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_set_std)
|
||||
conan_message(STATUS "Conan: Adjusting language standard")
|
||||
# Do not warn "Manually-specified variables were not used by the project"
|
||||
set(ignorevar "${CONAN_STD_CXX_FLAG}${CONAN_CMAKE_CXX_STANDARD}${CONAN_CMAKE_CXX_EXTENSIONS}")
|
||||
if (CMAKE_VERSION VERSION_LESS "3.1" OR
|
||||
(CMAKE_VERSION VERSION_LESS "3.12" AND ("${CONAN_CMAKE_CXX_STANDARD}" STREQUAL "20" OR "${CONAN_CMAKE_CXX_STANDARD}" STREQUAL "gnu20")))
|
||||
if(CONAN_STD_CXX_FLAG)
|
||||
conan_message(STATUS "Conan setting CXX_FLAGS flags: ${CONAN_STD_CXX_FLAG}")
|
||||
set(CMAKE_CXX_FLAGS "${CONAN_STD_CXX_FLAG} ${CMAKE_CXX_FLAGS}")
|
||||
endif()
|
||||
else()
|
||||
if(CONAN_CMAKE_CXX_STANDARD)
|
||||
conan_message(STATUS "Conan setting CPP STANDARD: ${CONAN_CMAKE_CXX_STANDARD} WITH EXTENSIONS ${CONAN_CMAKE_CXX_EXTENSIONS}")
|
||||
set(CMAKE_CXX_STANDARD ${CONAN_CMAKE_CXX_STANDARD})
|
||||
set(CMAKE_CXX_EXTENSIONS ${CONAN_CMAKE_CXX_EXTENSIONS})
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_set_rpath)
|
||||
conan_message(STATUS "Conan: Adjusting default RPATHs Conan policies")
|
||||
if(APPLE)
|
||||
# https://cmake.org/Wiki/CMake_RPATH_handling
|
||||
# CONAN GUIDE: All generated libraries should have the id and dependencies to other
|
||||
# dylibs without path, just the name, EX:
|
||||
# libMyLib1.dylib:
|
||||
# libMyLib1.dylib (compatibility version 0.0.0, current version 0.0.0)
|
||||
# libMyLib0.dylib (compatibility version 0.0.0, current version 0.0.0)
|
||||
# /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 120.0.0)
|
||||
# /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
|
||||
# AVOID RPATH FOR *.dylib, ALL LIBS BETWEEN THEM AND THE EXE
|
||||
# SHOULD BE ON THE LINKER RESOLVER PATH (./ IS ONE OF THEM)
|
||||
set(CMAKE_SKIP_RPATH 1 CACHE BOOL "rpaths" FORCE)
|
||||
# Policy CMP0068
|
||||
# We want the old behavior, in CMake >= 3.9 CMAKE_SKIP_RPATH won't affect the install_name in OSX
|
||||
set(CMAKE_INSTALL_NAME_DIR "")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_set_fpic)
|
||||
if(DEFINED CONAN_CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
conan_message(STATUS "Conan: Adjusting fPIC flag (${CONAN_CMAKE_POSITION_INDEPENDENT_CODE})")
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ${CONAN_CMAKE_POSITION_INDEPENDENT_CODE})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_output_dirs_setup)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
|
||||
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_split_version VERSION_STRING MAJOR MINOR)
|
||||
#make a list from the version string
|
||||
string(REPLACE "." ";" VERSION_LIST "${VERSION_STRING}")
|
||||
|
||||
#write output values
|
||||
list(LENGTH VERSION_LIST _version_len)
|
||||
list(GET VERSION_LIST 0 ${MAJOR})
|
||||
if(${_version_len} GREATER 1)
|
||||
list(GET VERSION_LIST 1 ${MINOR})
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_error_compiler_version)
|
||||
message(FATAL_ERROR "Detected a mismatch for the compiler version between your conan profile settings and CMake: \n"
|
||||
"Compiler version specified in your conan profile: ${CONAN_COMPILER_VERSION}\n"
|
||||
"Compiler version detected in CMake: ${VERSION_MAJOR}.${VERSION_MINOR}\n"
|
||||
"Please check your conan profile settings (conan profile show [default|your_profile_name])\n"
|
||||
"P.S. You may set CONAN_DISABLE_CHECK_COMPILER CMake variable in order to disable this check."
|
||||
)
|
||||
endmacro()
|
||||
|
||||
set(_CONAN_CURRENT_DIR ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
function(conan_get_compiler CONAN_INFO_COMPILER CONAN_INFO_COMPILER_VERSION)
|
||||
conan_message(STATUS "Current conanbuildinfo.cmake directory: " ${_CONAN_CURRENT_DIR})
|
||||
if(NOT EXISTS ${_CONAN_CURRENT_DIR}/conaninfo.txt)
|
||||
conan_message(STATUS "WARN: conaninfo.txt not found")
|
||||
return()
|
||||
endif()
|
||||
|
||||
file (READ "${_CONAN_CURRENT_DIR}/conaninfo.txt" CONANINFO)
|
||||
|
||||
# MATCHALL will match all, including the last one, which is the full_settings one
|
||||
string(REGEX MATCH "full_settings.*" _FULL_SETTINGS_MATCHED ${CONANINFO})
|
||||
string(REGEX MATCH "compiler=([-A-Za-z0-9_ ]+)" _MATCHED ${_FULL_SETTINGS_MATCHED})
|
||||
if(DEFINED CMAKE_MATCH_1)
|
||||
string(STRIP "${CMAKE_MATCH_1}" _CONAN_INFO_COMPILER)
|
||||
set(${CONAN_INFO_COMPILER} ${_CONAN_INFO_COMPILER} PARENT_SCOPE)
|
||||
endif()
|
||||
|
||||
string(REGEX MATCH "compiler.version=([-A-Za-z0-9_.]+)" _MATCHED ${_FULL_SETTINGS_MATCHED})
|
||||
if(DEFINED CMAKE_MATCH_1)
|
||||
string(STRIP "${CMAKE_MATCH_1}" _CONAN_INFO_COMPILER_VERSION)
|
||||
set(${CONAN_INFO_COMPILER_VERSION} ${_CONAN_INFO_COMPILER_VERSION} PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
function(check_compiler_version)
|
||||
conan_split_version(${CMAKE_CXX_COMPILER_VERSION} VERSION_MAJOR VERSION_MINOR)
|
||||
if(DEFINED CONAN_SETTINGS_COMPILER_TOOLSET)
|
||||
conan_message(STATUS "Conan: Skipping compiler check: Declared 'compiler.toolset'")
|
||||
return()
|
||||
endif()
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
# MSVC_VERSION is defined since 2.8.2 at least
|
||||
# https://cmake.org/cmake/help/v2.8.2/cmake.html#variable:MSVC_VERSION
|
||||
# https://cmake.org/cmake/help/v3.14/variable/MSVC_VERSION.html
|
||||
if(
|
||||
# 1930 = VS 17.0 (v143 toolset)
|
||||
(CONAN_COMPILER_VERSION STREQUAL "17" AND NOT((MSVC_VERSION EQUAL 1930) OR (MSVC_VERSION GREATER 1930))) OR
|
||||
# 1920-1929 = VS 16.0 (v142 toolset)
|
||||
(CONAN_COMPILER_VERSION STREQUAL "16" AND NOT((MSVC_VERSION GREATER 1919) AND (MSVC_VERSION LESS 1930))) OR
|
||||
# 1910-1919 = VS 15.0 (v141 toolset)
|
||||
(CONAN_COMPILER_VERSION STREQUAL "15" AND NOT((MSVC_VERSION GREATER 1909) AND (MSVC_VERSION LESS 1920))) OR
|
||||
# 1900 = VS 14.0 (v140 toolset)
|
||||
(CONAN_COMPILER_VERSION STREQUAL "14" AND NOT(MSVC_VERSION EQUAL 1900)) OR
|
||||
# 1800 = VS 12.0 (v120 toolset)
|
||||
(CONAN_COMPILER_VERSION STREQUAL "12" AND NOT VERSION_MAJOR STREQUAL "18") OR
|
||||
# 1700 = VS 11.0 (v110 toolset)
|
||||
(CONAN_COMPILER_VERSION STREQUAL "11" AND NOT VERSION_MAJOR STREQUAL "17") OR
|
||||
# 1600 = VS 10.0 (v100 toolset)
|
||||
(CONAN_COMPILER_VERSION STREQUAL "10" AND NOT VERSION_MAJOR STREQUAL "16") OR
|
||||
# 1500 = VS 9.0 (v90 toolset)
|
||||
(CONAN_COMPILER_VERSION STREQUAL "9" AND NOT VERSION_MAJOR STREQUAL "15") OR
|
||||
# 1400 = VS 8.0 (v80 toolset)
|
||||
(CONAN_COMPILER_VERSION STREQUAL "8" AND NOT VERSION_MAJOR STREQUAL "14") OR
|
||||
# 1310 = VS 7.1, 1300 = VS 7.0
|
||||
(CONAN_COMPILER_VERSION STREQUAL "7" AND NOT VERSION_MAJOR STREQUAL "13") OR
|
||||
# 1200 = VS 6.0
|
||||
(CONAN_COMPILER_VERSION STREQUAL "6" AND NOT VERSION_MAJOR STREQUAL "12") )
|
||||
conan_error_compiler_version()
|
||||
endif()
|
||||
elseif(CONAN_COMPILER STREQUAL "gcc")
|
||||
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
|
||||
set(_CHECK_VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
|
||||
set(_CONAN_VERSION ${CONAN_COMPILER_MAJOR}.${CONAN_COMPILER_MINOR})
|
||||
if(NOT ${CONAN_COMPILER_VERSION} VERSION_LESS 5.0)
|
||||
conan_message(STATUS "Conan: Compiler GCC>=5, checking major version ${CONAN_COMPILER_VERSION}")
|
||||
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
|
||||
if("${CONAN_COMPILER_MINOR}" STREQUAL "")
|
||||
set(_CHECK_VERSION ${VERSION_MAJOR})
|
||||
set(_CONAN_VERSION ${CONAN_COMPILER_MAJOR})
|
||||
endif()
|
||||
endif()
|
||||
conan_message(STATUS "Conan: Checking correct version: ${_CHECK_VERSION}")
|
||||
if(NOT ${_CHECK_VERSION} VERSION_EQUAL ${_CONAN_VERSION})
|
||||
conan_error_compiler_version()
|
||||
endif()
|
||||
elseif(CONAN_COMPILER STREQUAL "clang")
|
||||
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
|
||||
set(_CHECK_VERSION ${VERSION_MAJOR}.${VERSION_MINOR})
|
||||
set(_CONAN_VERSION ${CONAN_COMPILER_MAJOR}.${CONAN_COMPILER_MINOR})
|
||||
if(NOT ${CONAN_COMPILER_VERSION} VERSION_LESS 8.0)
|
||||
conan_message(STATUS "Conan: Compiler Clang>=8, checking major version ${CONAN_COMPILER_VERSION}")
|
||||
if("${CONAN_COMPILER_MINOR}" STREQUAL "")
|
||||
set(_CHECK_VERSION ${VERSION_MAJOR})
|
||||
set(_CONAN_VERSION ${CONAN_COMPILER_MAJOR})
|
||||
endif()
|
||||
endif()
|
||||
conan_message(STATUS "Conan: Checking correct version: ${_CHECK_VERSION}")
|
||||
if(NOT ${_CHECK_VERSION} VERSION_EQUAL ${_CONAN_VERSION})
|
||||
conan_error_compiler_version()
|
||||
endif()
|
||||
elseif(CONAN_COMPILER STREQUAL "apple-clang" OR CONAN_COMPILER STREQUAL "sun-cc" OR CONAN_COMPILER STREQUAL "mcst-lcc")
|
||||
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
|
||||
if(${CONAN_COMPILER_MAJOR} VERSION_GREATER_EQUAL "13" AND "${CONAN_COMPILER_MINOR}" STREQUAL "" AND ${CONAN_COMPILER_MAJOR} VERSION_EQUAL ${VERSION_MAJOR})
|
||||
# This is correct, 13.X is considered 13
|
||||
elseif(NOT ${VERSION_MAJOR}.${VERSION_MINOR} VERSION_EQUAL ${CONAN_COMPILER_MAJOR}.${CONAN_COMPILER_MINOR})
|
||||
conan_error_compiler_version()
|
||||
endif()
|
||||
elseif(CONAN_COMPILER STREQUAL "intel")
|
||||
conan_split_version(${CONAN_COMPILER_VERSION} CONAN_COMPILER_MAJOR CONAN_COMPILER_MINOR)
|
||||
if(NOT ${CONAN_COMPILER_VERSION} VERSION_LESS 19.1)
|
||||
if(NOT ${VERSION_MAJOR}.${VERSION_MINOR} VERSION_EQUAL ${CONAN_COMPILER_MAJOR}.${CONAN_COMPILER_MINOR})
|
||||
conan_error_compiler_version()
|
||||
endif()
|
||||
else()
|
||||
if(NOT ${VERSION_MAJOR} VERSION_EQUAL ${CONAN_COMPILER_MAJOR})
|
||||
conan_error_compiler_version()
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
conan_message(STATUS "WARN: Unknown compiler '${CONAN_COMPILER}', skipping the version check...")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
|
||||
function(conan_check_compiler)
|
||||
if(CONAN_DISABLE_CHECK_COMPILER)
|
||||
conan_message(STATUS "WARN: Disabled conan compiler checks")
|
||||
return()
|
||||
endif()
|
||||
if(NOT DEFINED CMAKE_CXX_COMPILER_ID)
|
||||
if(DEFINED CMAKE_C_COMPILER_ID)
|
||||
conan_message(STATUS "This project seems to be plain C, using '${CMAKE_C_COMPILER_ID}' compiler")
|
||||
set(CMAKE_CXX_COMPILER_ID ${CMAKE_C_COMPILER_ID})
|
||||
set(CMAKE_CXX_COMPILER_VERSION ${CMAKE_C_COMPILER_VERSION})
|
||||
else()
|
||||
message(FATAL_ERROR "This project seems to be plain C, but no compiler defined")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT CMAKE_CXX_COMPILER_ID AND NOT CMAKE_C_COMPILER_ID)
|
||||
# This use case happens when compiler is not identified by CMake, but the compilers are there and work
|
||||
conan_message(STATUS "*** WARN: CMake was not able to identify a C or C++ compiler ***")
|
||||
conan_message(STATUS "*** WARN: Disabling compiler checks. Please make sure your settings match your environment ***")
|
||||
return()
|
||||
endif()
|
||||
if(NOT DEFINED CONAN_COMPILER)
|
||||
conan_get_compiler(CONAN_COMPILER CONAN_COMPILER_VERSION)
|
||||
if(NOT DEFINED CONAN_COMPILER)
|
||||
conan_message(STATUS "WARN: CONAN_COMPILER variable not set, please make sure yourself that "
|
||||
"your compiler and version matches your declared settings")
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL ${CMAKE_SYSTEM_NAME})
|
||||
set(CROSS_BUILDING 1)
|
||||
endif()
|
||||
|
||||
# If using VS, verify toolset
|
||||
if (CONAN_COMPILER STREQUAL "Visual Studio")
|
||||
if (CONAN_SETTINGS_COMPILER_TOOLSET MATCHES "LLVM" OR
|
||||
CONAN_SETTINGS_COMPILER_TOOLSET MATCHES "llvm" OR
|
||||
CONAN_SETTINGS_COMPILER_TOOLSET MATCHES "clang" OR
|
||||
CONAN_SETTINGS_COMPILER_TOOLSET MATCHES "Clang")
|
||||
set(EXPECTED_CMAKE_CXX_COMPILER_ID "Clang")
|
||||
elseif (CONAN_SETTINGS_COMPILER_TOOLSET MATCHES "Intel")
|
||||
set(EXPECTED_CMAKE_CXX_COMPILER_ID "Intel")
|
||||
else()
|
||||
set(EXPECTED_CMAKE_CXX_COMPILER_ID "MSVC")
|
||||
endif()
|
||||
|
||||
if (NOT CMAKE_CXX_COMPILER_ID MATCHES ${EXPECTED_CMAKE_CXX_COMPILER_ID})
|
||||
message(FATAL_ERROR "Incorrect '${CONAN_COMPILER}'. Toolset specifies compiler as '${EXPECTED_CMAKE_CXX_COMPILER_ID}' "
|
||||
"but CMake detected '${CMAKE_CXX_COMPILER_ID}'")
|
||||
endif()
|
||||
|
||||
# Avoid checks when cross compiling, apple-clang crashes because its APPLE but not apple-clang
|
||||
# Actually CMake is detecting "clang" when you are using apple-clang, only if CMP0025 is set to NEW will detect apple-clang
|
||||
elseif((CONAN_COMPILER STREQUAL "gcc" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "GNU") OR
|
||||
(CONAN_COMPILER STREQUAL "apple-clang" AND NOT CROSS_BUILDING AND (NOT APPLE OR NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")) OR
|
||||
(CONAN_COMPILER STREQUAL "clang" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR
|
||||
(CONAN_COMPILER STREQUAL "sun-cc" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "SunPro") )
|
||||
message(FATAL_ERROR "Incorrect '${CONAN_COMPILER}', is not the one detected by CMake: '${CMAKE_CXX_COMPILER_ID}'")
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT DEFINED CONAN_COMPILER_VERSION)
|
||||
conan_message(STATUS "WARN: CONAN_COMPILER_VERSION variable not set, please make sure yourself "
|
||||
"that your compiler version matches your declared settings")
|
||||
return()
|
||||
endif()
|
||||
check_compiler_version()
|
||||
endfunction()
|
||||
|
||||
|
||||
macro(conan_set_flags build_type)
|
||||
set(CMAKE_CXX_FLAGS${build_type} "${CMAKE_CXX_FLAGS${build_type}} ${CONAN_CXX_FLAGS${build_type}}")
|
||||
set(CMAKE_C_FLAGS${build_type} "${CMAKE_C_FLAGS${build_type}} ${CONAN_C_FLAGS${build_type}}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS${build_type} "${CMAKE_SHARED_LINKER_FLAGS${build_type}} ${CONAN_SHARED_LINKER_FLAGS${build_type}}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS${build_type} "${CMAKE_EXE_LINKER_FLAGS${build_type}} ${CONAN_EXE_LINKER_FLAGS${build_type}}")
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_global_flags)
|
||||
if(CONAN_SYSTEM_INCLUDES)
|
||||
include_directories(SYSTEM ${CONAN_INCLUDE_DIRS}
|
||||
"$<$<CONFIG:Release>:${CONAN_INCLUDE_DIRS_RELEASE}>"
|
||||
"$<$<CONFIG:RelWithDebInfo>:${CONAN_INCLUDE_DIRS_RELWITHDEBINFO}>"
|
||||
"$<$<CONFIG:MinSizeRel>:${CONAN_INCLUDE_DIRS_MINSIZEREL}>"
|
||||
"$<$<CONFIG:Debug>:${CONAN_INCLUDE_DIRS_DEBUG}>")
|
||||
else()
|
||||
include_directories(${CONAN_INCLUDE_DIRS}
|
||||
"$<$<CONFIG:Release>:${CONAN_INCLUDE_DIRS_RELEASE}>"
|
||||
"$<$<CONFIG:RelWithDebInfo>:${CONAN_INCLUDE_DIRS_RELWITHDEBINFO}>"
|
||||
"$<$<CONFIG:MinSizeRel>:${CONAN_INCLUDE_DIRS_MINSIZEREL}>"
|
||||
"$<$<CONFIG:Debug>:${CONAN_INCLUDE_DIRS_DEBUG}>")
|
||||
endif()
|
||||
|
||||
link_directories(${CONAN_LIB_DIRS})
|
||||
|
||||
conan_find_libraries_abs_path("${CONAN_LIBS_DEBUG}" "${CONAN_LIB_DIRS_DEBUG}"
|
||||
CONAN_LIBS_DEBUG)
|
||||
conan_find_libraries_abs_path("${CONAN_LIBS_RELEASE}" "${CONAN_LIB_DIRS_RELEASE}"
|
||||
CONAN_LIBS_RELEASE)
|
||||
conan_find_libraries_abs_path("${CONAN_LIBS_RELWITHDEBINFO}" "${CONAN_LIB_DIRS_RELWITHDEBINFO}"
|
||||
CONAN_LIBS_RELWITHDEBINFO)
|
||||
conan_find_libraries_abs_path("${CONAN_LIBS_MINSIZEREL}" "${CONAN_LIB_DIRS_MINSIZEREL}"
|
||||
CONAN_LIBS_MINSIZEREL)
|
||||
|
||||
add_compile_options(${CONAN_DEFINES}
|
||||
"$<$<CONFIG:Debug>:${CONAN_DEFINES_DEBUG}>"
|
||||
"$<$<CONFIG:Release>:${CONAN_DEFINES_RELEASE}>"
|
||||
"$<$<CONFIG:RelWithDebInfo>:${CONAN_DEFINES_RELWITHDEBINFO}>"
|
||||
"$<$<CONFIG:MinSizeRel>:${CONAN_DEFINES_MINSIZEREL}>")
|
||||
|
||||
conan_set_flags("")
|
||||
conan_set_flags("_RELEASE")
|
||||
conan_set_flags("_DEBUG")
|
||||
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_target_link_libraries target)
|
||||
if(CONAN_TARGETS)
|
||||
target_link_libraries(${target} ${CONAN_TARGETS})
|
||||
else()
|
||||
target_link_libraries(${target} ${CONAN_LIBS})
|
||||
foreach(_LIB ${CONAN_LIBS_RELEASE})
|
||||
target_link_libraries(${target} optimized ${_LIB})
|
||||
endforeach()
|
||||
foreach(_LIB ${CONAN_LIBS_DEBUG})
|
||||
target_link_libraries(${target} debug ${_LIB})
|
||||
endforeach()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(conan_include_build_modules)
|
||||
if(CMAKE_BUILD_TYPE)
|
||||
if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
|
||||
set(CONAN_BUILD_MODULES_PATHS ${CONAN_BUILD_MODULES_PATHS_DEBUG} ${CONAN_BUILD_MODULES_PATHS})
|
||||
elseif(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
||||
set(CONAN_BUILD_MODULES_PATHS ${CONAN_BUILD_MODULES_PATHS_RELEASE} ${CONAN_BUILD_MODULES_PATHS})
|
||||
elseif(${CMAKE_BUILD_TYPE} MATCHES "RelWithDebInfo")
|
||||
set(CONAN_BUILD_MODULES_PATHS ${CONAN_BUILD_MODULES_PATHS_RELWITHDEBINFO} ${CONAN_BUILD_MODULES_PATHS})
|
||||
elseif(${CMAKE_BUILD_TYPE} MATCHES "MinSizeRel")
|
||||
set(CONAN_BUILD_MODULES_PATHS ${CONAN_BUILD_MODULES_PATHS_MINSIZEREL} ${CONAN_BUILD_MODULES_PATHS})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
foreach(_BUILD_MODULE_PATH ${CONAN_BUILD_MODULES_PATHS})
|
||||
include(${_BUILD_MODULE_PATH})
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
|
||||
### Definition of user declared vars (user_info) ###
|
||||
|
||||
set(CONAN_USER_BOOST_stacktrace_addr2line_available "False")
|
353
build/conanbuildinfo.txt
Normal file
353
build/conanbuildinfo.txt
Normal file
@ -0,0 +1,353 @@
|
||||
[includedirs]
|
||||
C:/.conan/029ec3/1/include
|
||||
C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include
|
||||
C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/include
|
||||
|
||||
[libdirs]
|
||||
C:/.conan/029ec3/1/lib
|
||||
C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/lib
|
||||
C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/lib
|
||||
|
||||
[bindirs]
|
||||
C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/bin
|
||||
|
||||
[resdirs]
|
||||
|
||||
|
||||
[builddirs]
|
||||
C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/
|
||||
C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/
|
||||
|
||||
[libs]
|
||||
libboost_contract
|
||||
libboost_coroutine
|
||||
libboost_context
|
||||
libboost_graph
|
||||
libboost_iostreams
|
||||
libboost_json
|
||||
libboost_locale
|
||||
libboost_log_setup
|
||||
libboost_log
|
||||
libboost_math_c99
|
||||
libboost_math_c99f
|
||||
libboost_math_c99l
|
||||
libboost_math_tr1
|
||||
libboost_math_tr1f
|
||||
libboost_math_tr1l
|
||||
libboost_nowide
|
||||
libboost_program_options
|
||||
libboost_random
|
||||
libboost_regex
|
||||
libboost_stacktrace_noop
|
||||
libboost_stacktrace_windbg
|
||||
libboost_stacktrace_windbg_cached
|
||||
libboost_timer
|
||||
libboost_type_erasure
|
||||
libboost_thread
|
||||
libboost_chrono
|
||||
libboost_container
|
||||
libboost_date_time
|
||||
libboost_unit_test_framework
|
||||
libboost_prg_exec_monitor
|
||||
libboost_test_exec_monitor
|
||||
libboost_exception
|
||||
libboost_url
|
||||
libboost_wave
|
||||
libboost_filesystem
|
||||
libboost_atomic
|
||||
libboost_wserialization
|
||||
libboost_serialization
|
||||
zlib
|
||||
bz2
|
||||
|
||||
[system_libs]
|
||||
ole32
|
||||
dbgeng
|
||||
bcrypt
|
||||
ntdll
|
||||
shell32
|
||||
Advapi32
|
||||
user32
|
||||
|
||||
[defines]
|
||||
BOOST_STACKTRACE_USE_NOOP
|
||||
BOOST_STACKTRACE_USE_WINDBG
|
||||
BOOST_STACKTRACE_USE_WINDBG_CACHED
|
||||
BOOST_ALL_NO_LIB
|
||||
|
||||
[cppflags]
|
||||
|
||||
|
||||
[cxxflags]
|
||||
|
||||
|
||||
[cflags]
|
||||
|
||||
|
||||
[sharedlinkflags]
|
||||
|
||||
|
||||
[exelinkflags]
|
||||
|
||||
|
||||
[sysroot]
|
||||
|
||||
|
||||
[frameworks]
|
||||
|
||||
|
||||
[frameworkdirs]
|
||||
|
||||
|
||||
|
||||
[includedirs_boost]
|
||||
C:/.conan/029ec3/1/include
|
||||
|
||||
[libdirs_boost]
|
||||
C:/.conan/029ec3/1/lib
|
||||
|
||||
[bindirs_boost]
|
||||
|
||||
|
||||
[resdirs_boost]
|
||||
|
||||
|
||||
[builddirs_boost]
|
||||
|
||||
|
||||
[libs_boost]
|
||||
libboost_contract
|
||||
libboost_coroutine
|
||||
libboost_context
|
||||
libboost_graph
|
||||
libboost_iostreams
|
||||
libboost_json
|
||||
libboost_locale
|
||||
libboost_log_setup
|
||||
libboost_log
|
||||
libboost_math_c99
|
||||
libboost_math_c99f
|
||||
libboost_math_c99l
|
||||
libboost_math_tr1
|
||||
libboost_math_tr1f
|
||||
libboost_math_tr1l
|
||||
libboost_nowide
|
||||
libboost_program_options
|
||||
libboost_random
|
||||
libboost_regex
|
||||
libboost_stacktrace_noop
|
||||
libboost_stacktrace_windbg
|
||||
libboost_stacktrace_windbg_cached
|
||||
libboost_timer
|
||||
libboost_type_erasure
|
||||
libboost_thread
|
||||
libboost_chrono
|
||||
libboost_container
|
||||
libboost_date_time
|
||||
libboost_unit_test_framework
|
||||
libboost_prg_exec_monitor
|
||||
libboost_test_exec_monitor
|
||||
libboost_exception
|
||||
libboost_url
|
||||
libboost_wave
|
||||
libboost_filesystem
|
||||
libboost_atomic
|
||||
libboost_wserialization
|
||||
libboost_serialization
|
||||
|
||||
[system_libs_boost]
|
||||
ole32
|
||||
dbgeng
|
||||
bcrypt
|
||||
ntdll
|
||||
shell32
|
||||
Advapi32
|
||||
user32
|
||||
|
||||
[defines_boost]
|
||||
BOOST_STACKTRACE_USE_NOOP
|
||||
BOOST_STACKTRACE_USE_WINDBG
|
||||
BOOST_STACKTRACE_USE_WINDBG_CACHED
|
||||
BOOST_ALL_NO_LIB
|
||||
|
||||
[cppflags_boost]
|
||||
|
||||
|
||||
[cxxflags_boost]
|
||||
|
||||
|
||||
[cflags_boost]
|
||||
|
||||
|
||||
[sharedlinkflags_boost]
|
||||
|
||||
|
||||
[exelinkflags_boost]
|
||||
|
||||
|
||||
[sysroot_boost]
|
||||
|
||||
|
||||
[frameworks_boost]
|
||||
|
||||
|
||||
[frameworkdirs_boost]
|
||||
|
||||
|
||||
[rootpath_boost]
|
||||
C:/.conan/029ec3/1
|
||||
|
||||
[name_boost]
|
||||
boost
|
||||
|
||||
[version_boost]
|
||||
1.84.0
|
||||
|
||||
[generatornames_boost]
|
||||
cmake_find_package=Boost
|
||||
cmake_find_package_multi=Boost
|
||||
|
||||
[generatorfilenames_boost]
|
||||
cmake_find_package=Boost
|
||||
cmake_find_package_multi=Boost
|
||||
|
||||
|
||||
[includedirs_zlib]
|
||||
C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include
|
||||
|
||||
[libdirs_zlib]
|
||||
C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/lib
|
||||
|
||||
[bindirs_zlib]
|
||||
|
||||
|
||||
[resdirs_zlib]
|
||||
|
||||
|
||||
[builddirs_zlib]
|
||||
C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/
|
||||
|
||||
[libs_zlib]
|
||||
zlib
|
||||
|
||||
[system_libs_zlib]
|
||||
|
||||
|
||||
[defines_zlib]
|
||||
|
||||
|
||||
[cppflags_zlib]
|
||||
|
||||
|
||||
[cxxflags_zlib]
|
||||
|
||||
|
||||
[cflags_zlib]
|
||||
|
||||
|
||||
[sharedlinkflags_zlib]
|
||||
|
||||
|
||||
[exelinkflags_zlib]
|
||||
|
||||
|
||||
[sysroot_zlib]
|
||||
|
||||
|
||||
[frameworks_zlib]
|
||||
|
||||
|
||||
[frameworkdirs_zlib]
|
||||
|
||||
|
||||
[rootpath_zlib]
|
||||
C:/Users/Антон/.conan/data/zlib/1.3.1/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b
|
||||
|
||||
[name_zlib]
|
||||
zlib
|
||||
|
||||
[version_zlib]
|
||||
1.3.1
|
||||
|
||||
[generatornames_zlib]
|
||||
cmake_find_package=ZLIB
|
||||
cmake_find_package_multi=ZLIB
|
||||
|
||||
[generatorfilenames_zlib]
|
||||
|
||||
|
||||
|
||||
[includedirs_bzip2]
|
||||
C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/include
|
||||
|
||||
[libdirs_bzip2]
|
||||
C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/lib
|
||||
|
||||
[bindirs_bzip2]
|
||||
C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/bin
|
||||
|
||||
[resdirs_bzip2]
|
||||
|
||||
|
||||
[builddirs_bzip2]
|
||||
C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201/
|
||||
|
||||
[libs_bzip2]
|
||||
bz2
|
||||
|
||||
[system_libs_bzip2]
|
||||
|
||||
|
||||
[defines_bzip2]
|
||||
|
||||
|
||||
[cppflags_bzip2]
|
||||
|
||||
|
||||
[cxxflags_bzip2]
|
||||
|
||||
|
||||
[cflags_bzip2]
|
||||
|
||||
|
||||
[sharedlinkflags_bzip2]
|
||||
|
||||
|
||||
[exelinkflags_bzip2]
|
||||
|
||||
|
||||
[sysroot_bzip2]
|
||||
|
||||
|
||||
[frameworks_bzip2]
|
||||
|
||||
|
||||
[frameworkdirs_bzip2]
|
||||
|
||||
|
||||
[rootpath_bzip2]
|
||||
C:/Users/Антон/.conan/data/bzip2/1.0.8/_/_/package/53b5fd22ba061620078deefdae9a437c5f693201
|
||||
|
||||
[name_bzip2]
|
||||
bzip2
|
||||
|
||||
[version_bzip2]
|
||||
1.0.8
|
||||
|
||||
[generatornames_bzip2]
|
||||
cmake_find_package=BZip2
|
||||
cmake_find_package_multi=BZip2
|
||||
|
||||
[generatorfilenames_bzip2]
|
||||
|
||||
|
||||
|
||||
[USER_boost]
|
||||
stacktrace_addr2line_available=False
|
||||
[USER_bzip2]
|
||||
[USER_zlib]
|
||||
[ENV_boost]
|
||||
BOOST_ROOT=C:\.conan\029ec3\1
|
||||
[ENV_zlib]
|
||||
[ENV_bzip2]
|
||||
PATH=["C:\Users\Антон\.conan\data\bzip2\1.0.8\_\_\package\53b5fd22ba061620078deefdae9a437c5f693201\bin"]
|
102
build/conaninfo.txt
Normal file
102
build/conaninfo.txt
Normal file
@ -0,0 +1,102 @@
|
||||
[settings]
|
||||
arch=x86_64
|
||||
build_type=Release
|
||||
compiler=Visual Studio
|
||||
compiler.runtime=MD
|
||||
compiler.version=17
|
||||
os=Windows
|
||||
|
||||
[requires]
|
||||
boost/1.Y.Z
|
||||
|
||||
[options]
|
||||
|
||||
|
||||
[full_settings]
|
||||
arch=x86_64
|
||||
arch_build=x86_64
|
||||
build_type=Release
|
||||
compiler=Visual Studio
|
||||
compiler.runtime=MD
|
||||
compiler.version=17
|
||||
os=Windows
|
||||
os_build=Windows
|
||||
|
||||
[full_requires]
|
||||
boost/1.84.0:e50863e182b9f1a9ce9e711c031065f1fe5f7f78
|
||||
bzip2/1.0.8:53b5fd22ba061620078deefdae9a437c5f693201
|
||||
zlib/1.3.1:5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b
|
||||
|
||||
[full_options]
|
||||
boost:asio_no_deprecated=False
|
||||
boost:buildid=None
|
||||
boost:bzip2=True
|
||||
boost:debug_level=0
|
||||
boost:diagnostic_definitions=False
|
||||
boost:error_code_header_only=False
|
||||
boost:extra_b2_flags=None
|
||||
boost:filesystem_no_deprecated=False
|
||||
boost:filesystem_use_std_fs=False
|
||||
boost:filesystem_version=None
|
||||
boost:header_only=False
|
||||
boost:i18n_backend=deprecated
|
||||
boost:i18n_backend_iconv=off
|
||||
boost:i18n_backend_icu=False
|
||||
boost:layout=system
|
||||
boost:lzma=False
|
||||
boost:magic_autolink=False
|
||||
boost:multithreading=True
|
||||
boost:namespace=boost
|
||||
boost:namespace_alias=False
|
||||
boost:pch=True
|
||||
boost:python_executable=None
|
||||
boost:python_version=None
|
||||
boost:segmented_stacks=False
|
||||
boost:shared=False
|
||||
boost:system_no_deprecated=False
|
||||
boost:system_use_utf8=False
|
||||
boost:visibility=hidden
|
||||
boost:without_atomic=False
|
||||
boost:without_chrono=False
|
||||
boost:without_cobalt=True
|
||||
boost:without_container=False
|
||||
boost:without_context=False
|
||||
boost:without_contract=False
|
||||
boost:without_coroutine=False
|
||||
boost:without_date_time=False
|
||||
boost:without_exception=False
|
||||
boost:without_fiber=True
|
||||
boost:without_filesystem=False
|
||||
boost:without_graph=False
|
||||
boost:without_graph_parallel=True
|
||||
boost:without_iostreams=False
|
||||
boost:without_json=False
|
||||
boost:without_locale=False
|
||||
boost:without_log=False
|
||||
boost:without_math=False
|
||||
boost:without_mpi=True
|
||||
boost:without_nowide=False
|
||||
boost:without_program_options=False
|
||||
boost:without_python=True
|
||||
boost:without_random=False
|
||||
boost:without_regex=False
|
||||
boost:without_serialization=False
|
||||
boost:without_stacktrace=False
|
||||
boost:without_system=False
|
||||
boost:without_test=False
|
||||
boost:without_thread=False
|
||||
boost:without_timer=False
|
||||
boost:without_type_erasure=False
|
||||
boost:without_url=False
|
||||
boost:without_wave=False
|
||||
boost:zlib=True
|
||||
boost:zstd=False
|
||||
bzip2:build_executable=True
|
||||
bzip2:shared=False
|
||||
zlib:shared=False
|
||||
|
||||
[recipe_hash]
|
||||
|
||||
|
||||
[env]
|
||||
|
274
build/graph_info.json
Normal file
274
build/graph_info.json
Normal file
@ -0,0 +1,274 @@
|
||||
{
|
||||
"options": [
|
||||
[
|
||||
"boost:asio_no_deprecated",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:buildid",
|
||||
"None"
|
||||
],
|
||||
[
|
||||
"boost:bzip2",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"boost:debug_level",
|
||||
"0"
|
||||
],
|
||||
[
|
||||
"boost:diagnostic_definitions",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:error_code_header_only",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:extra_b2_flags",
|
||||
"None"
|
||||
],
|
||||
[
|
||||
"boost:filesystem_no_deprecated",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:filesystem_use_std_fs",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:filesystem_version",
|
||||
"None"
|
||||
],
|
||||
[
|
||||
"boost:header_only",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:i18n_backend",
|
||||
"deprecated"
|
||||
],
|
||||
[
|
||||
"boost:i18n_backend_iconv",
|
||||
"off"
|
||||
],
|
||||
[
|
||||
"boost:i18n_backend_icu",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:layout",
|
||||
"system"
|
||||
],
|
||||
[
|
||||
"boost:lzma",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:magic_autolink",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:multithreading",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"boost:namespace",
|
||||
"boost"
|
||||
],
|
||||
[
|
||||
"boost:namespace_alias",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:pch",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"boost:python_executable",
|
||||
"None"
|
||||
],
|
||||
[
|
||||
"boost:python_version",
|
||||
"None"
|
||||
],
|
||||
[
|
||||
"boost:segmented_stacks",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:shared",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:system_no_deprecated",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:system_use_utf8",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:visibility",
|
||||
"hidden"
|
||||
],
|
||||
[
|
||||
"boost:without_atomic",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_chrono",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_cobalt",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"boost:without_container",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_context",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_contract",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_coroutine",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_date_time",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_exception",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_fiber",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"boost:without_filesystem",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_graph",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_graph_parallel",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"boost:without_iostreams",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_json",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_locale",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_log",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_math",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_mpi",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"boost:without_nowide",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_program_options",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_python",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"boost:without_random",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_regex",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_serialization",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_stacktrace",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_system",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_test",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_thread",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_timer",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_type_erasure",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_url",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:without_wave",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"boost:zlib",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"boost:zstd",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"bzip2:build_executable",
|
||||
"True"
|
||||
],
|
||||
[
|
||||
"bzip2:shared",
|
||||
"False"
|
||||
],
|
||||
[
|
||||
"zlib:shared",
|
||||
"False"
|
||||
]
|
||||
],
|
||||
"root": {
|
||||
"name": null,
|
||||
"version": null,
|
||||
"user": null,
|
||||
"channel": null
|
||||
}
|
||||
}
|
5
conanfile.txt
Normal file
5
conanfile.txt
Normal file
@ -0,0 +1,5 @@
|
||||
[requires]
|
||||
boost/1.84.0
|
||||
|
||||
[generators]
|
||||
cmake
|
72
src/Listener.cpp
Normal file
72
src/Listener.cpp
Normal file
@ -0,0 +1,72 @@
|
||||
#include "Listener.h"
|
||||
|
||||
namespace uad
|
||||
{
|
||||
Listener::Listener(boost::asio::io_context& ioc,
|
||||
boost::asio::ip::tcp::endpoint endpoint,
|
||||
const std::shared_ptr<const std::string>& doc_root)
|
||||
: ioc_(ioc), acceptor_(net::make_strand(ioc)), doc_root_(doc_root)
|
||||
{
|
||||
beast::error_code ec;
|
||||
|
||||
acceptor_.open(endpoint.protocol(), ec);
|
||||
if (ec)
|
||||
{
|
||||
uad::Fail(ec, "open");
|
||||
return;
|
||||
}
|
||||
|
||||
acceptor_.set_option(net::socket_base::reuse_address(true), ec);
|
||||
if (ec)
|
||||
{
|
||||
uad::Fail(ec, "set_option");
|
||||
return;
|
||||
}
|
||||
|
||||
acceptor_.bind(endpoint, ec);
|
||||
if (ec)
|
||||
{
|
||||
uad::Fail(ec, "bind");
|
||||
return;
|
||||
}
|
||||
|
||||
acceptor_.listen(
|
||||
net::socket_base::max_listen_connections, ec);
|
||||
if (ec)
|
||||
{
|
||||
uad::Fail(ec, "listen");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void Listener::Run()
|
||||
{
|
||||
DoAccept();
|
||||
}
|
||||
|
||||
void Listener::DoAccept()
|
||||
{
|
||||
acceptor_.async_accept(
|
||||
net::make_strand(ioc_),
|
||||
beast::bind_front_handler(
|
||||
&Listener::OnAccept,
|
||||
shared_from_this()));
|
||||
}
|
||||
|
||||
void Listener::OnAccept(beast::error_code ec, tcp::socket socket)
|
||||
{
|
||||
if (ec)
|
||||
{
|
||||
uad::Fail(ec, "accept");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
std::make_shared<uad::Session>(
|
||||
std::move(socket),
|
||||
doc_root_)->Run();
|
||||
}
|
||||
|
||||
DoAccept();
|
||||
}
|
||||
}
|
45
src/Listener.h
Normal file
45
src/Listener.h
Normal file
@ -0,0 +1,45 @@
|
||||
#include <boost/beast/core.hpp>
|
||||
#include <boost/beast/http.hpp>
|
||||
#include <boost/beast/version.hpp>
|
||||
#include <boost/asio/dispatch.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include "helpers.h"
|
||||
#include "Session.h"
|
||||
|
||||
namespace uad
|
||||
{
|
||||
namespace beast = boost::beast;
|
||||
namespace http = beast::http;
|
||||
namespace net = boost::asio;
|
||||
using tcp = boost::asio::ip::tcp;
|
||||
|
||||
class Listener : public std::enable_shared_from_this<Listener>
|
||||
{
|
||||
net::io_context& ioc_;
|
||||
tcp::acceptor acceptor_;
|
||||
std::shared_ptr<std::string const> doc_root_;
|
||||
|
||||
public:
|
||||
Listener(
|
||||
net::io_context& ioc,
|
||||
tcp::endpoint endpoint,
|
||||
std::shared_ptr<std::string const> const& doc_root);
|
||||
|
||||
void Run();
|
||||
|
||||
private:
|
||||
void DoAccept();
|
||||
|
||||
void OnAccept(beast::error_code ec, tcp::socket socket);
|
||||
};
|
||||
}
|
114
src/RequestHandlers/BasicRequestHandler.cpp
Normal file
114
src/RequestHandlers/BasicRequestHandler.cpp
Normal file
@ -0,0 +1,114 @@
|
||||
#include "BasicRequestHandler.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
#include "../content_type.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace string_view_literals;
|
||||
|
||||
namespace uad
|
||||
{
|
||||
namespace beast = boost::beast;
|
||||
namespace http = beast::http;
|
||||
namespace net = boost::asio;
|
||||
|
||||
http::message_generator HandleRequest(
|
||||
beast::string_view doc_root,
|
||||
http::request<http::string_body>&& req)
|
||||
{
|
||||
auto const bad_request =
|
||||
[&req](beast::string_view why)
|
||||
{
|
||||
http::response<http::string_body> res {http::status::bad_request, req.version()};
|
||||
res.set(http::field::server, BOOST_BEAST_VERSION_STRING);
|
||||
res.set(http::field::content_type, "text/html");
|
||||
res.keep_alive(req.keep_alive());
|
||||
res.body() = std::string(why);
|
||||
res.prepare_payload();
|
||||
return res;
|
||||
};
|
||||
|
||||
auto const not_found =
|
||||
[&req](beast::string_view target)
|
||||
{
|
||||
http::response<http::string_body> res {http::status::not_found, req.version()};
|
||||
res.set(http::field::server, BOOST_BEAST_VERSION_STRING);
|
||||
res.set(http::field::content_type, "text/html");
|
||||
res.keep_alive(req.keep_alive());
|
||||
res.body() = "The resource '" + std::string(target) + "' was not found.";
|
||||
res.prepare_payload();
|
||||
return res;
|
||||
};
|
||||
|
||||
auto const server_error =
|
||||
[&req](beast::string_view what)
|
||||
{
|
||||
http::response<http::string_body> res {http::status::internal_server_error, req.version()};
|
||||
res.set(http::field::server, BOOST_BEAST_VERSION_STRING);
|
||||
res.set(http::field::content_type, "text/html");
|
||||
res.keep_alive(req.keep_alive());
|
||||
res.body() = "An error occurred: '" + std::string(what) + "'";
|
||||
res.prepare_payload();
|
||||
return res;
|
||||
};
|
||||
|
||||
if (req.target() == "/HelloWorld"sv)
|
||||
{
|
||||
http::response<http::string_body> res {};
|
||||
res.body() = "{ \"Hello\": \"World\" }"sv;
|
||||
res.content_length(res.body().size());
|
||||
res.set(http::field::content_type, content_type::k_JSON);
|
||||
res.prepare_payload();
|
||||
res.keep_alive(req.keep_alive());
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
if (req.method() != http::verb::get &&
|
||||
req.method() != http::verb::head)
|
||||
return bad_request("Unknown HTTP-method");
|
||||
|
||||
if (req.target().empty() ||
|
||||
req.target()[0] != '/' ||
|
||||
req.target().find("..") != beast::string_view::npos)
|
||||
return bad_request("Illegal request-target");
|
||||
|
||||
std::string path = PathCat(doc_root, req.target());
|
||||
if (req.target().back() == '/')
|
||||
path.append("index.html");
|
||||
|
||||
beast::error_code ec;
|
||||
http::file_body::value_type body;
|
||||
body.open(path.c_str(), beast::file_mode::scan, ec);
|
||||
|
||||
if (ec == beast::errc::no_such_file_or_directory)
|
||||
return not_found(req.target());
|
||||
|
||||
if (ec)
|
||||
return server_error(ec.message());
|
||||
|
||||
auto const size = body.size();
|
||||
|
||||
if (req.method() == http::verb::head)
|
||||
{
|
||||
http::response<http::empty_body> res {http::status::ok, req.version()};
|
||||
res.set(http::field::server, BOOST_BEAST_VERSION_STRING);
|
||||
res.set(http::field::content_type, MimeType(path));
|
||||
res.content_length(size);
|
||||
res.keep_alive(req.keep_alive());
|
||||
return res;
|
||||
}
|
||||
|
||||
http::response<http::file_body> res {
|
||||
std::piecewise_construct,
|
||||
std::make_tuple(std::move(body)),
|
||||
std::make_tuple(http::status::ok, req.version())};
|
||||
res.set(http::field::server, BOOST_BEAST_VERSION_STRING);
|
||||
res.set(http::field::content_type, MimeType(path));
|
||||
res.content_length(size);
|
||||
res.keep_alive(req.keep_alive());
|
||||
return res;
|
||||
}
|
||||
}
|
30
src/RequestHandlers/BasicRequestHandler.h
Normal file
30
src/RequestHandlers/BasicRequestHandler.h
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/beast/core.hpp>
|
||||
#include <boost/beast/http.hpp>
|
||||
#include <boost/beast/version.hpp>
|
||||
#include <boost/asio/dispatch.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
#include <type_traits>
|
||||
|
||||
#include "./../helpers.h"
|
||||
|
||||
namespace uad
|
||||
{
|
||||
namespace beast = boost::beast;
|
||||
namespace http = beast::http;
|
||||
namespace net = boost::asio;
|
||||
|
||||
http::message_generator HandleRequest(
|
||||
beast::string_view doc_root,
|
||||
http::request<http::string_body>&& req);
|
||||
}
|
81
src/Session.cpp
Normal file
81
src/Session.cpp
Normal file
@ -0,0 +1,81 @@
|
||||
#include "RequestHandlers/BasicRequestHandler.h"
|
||||
#include "Session.h"
|
||||
|
||||
namespace uad
|
||||
{
|
||||
Session::Session(
|
||||
tcp::socket&& socket,
|
||||
std::shared_ptr<std::string const> const& doc_root)
|
||||
: stream_(std::move(socket)), doc_root_(doc_root) {}
|
||||
|
||||
void Session::Run()
|
||||
{
|
||||
net::dispatch(stream_.get_executor(),
|
||||
beast::bind_front_handler(
|
||||
&Session::DoRead,
|
||||
shared_from_this()));
|
||||
}
|
||||
|
||||
void Session::DoRead()
|
||||
{
|
||||
req_ = {};
|
||||
|
||||
stream_.expires_after(std::chrono::seconds(30));
|
||||
|
||||
http::async_read(stream_, buffer_, req_,
|
||||
beast::bind_front_handler(
|
||||
&Session::OnRead,
|
||||
shared_from_this()));
|
||||
}
|
||||
|
||||
void Session::OnRead(
|
||||
beast::error_code ec,
|
||||
std::size_t bytes_transferred)
|
||||
{
|
||||
boost::ignore_unused(bytes_transferred);
|
||||
|
||||
if (ec == http::error::end_of_stream)
|
||||
return DoClose();
|
||||
|
||||
if (ec)
|
||||
return Fail(ec, "read");
|
||||
|
||||
SendResponse(
|
||||
HandleRequest(*doc_root_, std::move(req_)));
|
||||
}
|
||||
|
||||
void Session::SendResponse(http::message_generator&& msg)
|
||||
{
|
||||
bool keep_alive = msg.keep_alive();
|
||||
|
||||
beast::async_write(
|
||||
stream_,
|
||||
std::move(msg),
|
||||
beast::bind_front_handler(
|
||||
&Session::OnWrite, shared_from_this(), keep_alive));
|
||||
}
|
||||
|
||||
void Session::OnWrite(
|
||||
bool keep_alive,
|
||||
beast::error_code ec,
|
||||
std::size_t bytes_transferred)
|
||||
{
|
||||
boost::ignore_unused(bytes_transferred);
|
||||
|
||||
if (ec)
|
||||
return uad::Fail(ec, "write");
|
||||
|
||||
if (!keep_alive)
|
||||
{
|
||||
return DoClose();
|
||||
}
|
||||
|
||||
DoRead();
|
||||
}
|
||||
|
||||
void Session::DoClose()
|
||||
{
|
||||
beast::error_code ec;
|
||||
stream_.socket().shutdown(tcp::socket::shutdown_send, ec);
|
||||
}
|
||||
}
|
49
src/Session.h
Normal file
49
src/Session.h
Normal file
@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/beast/core.hpp>
|
||||
#include <boost/beast/http.hpp>
|
||||
#include <boost/beast/version.hpp>
|
||||
#include <boost/asio/dispatch.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "helpers.h"
|
||||
|
||||
namespace uad
|
||||
{
|
||||
namespace beast = boost::beast;
|
||||
namespace http = beast::http;
|
||||
using tcp = boost::asio::ip::tcp;
|
||||
namespace net = boost::asio;
|
||||
|
||||
class Session : public std::enable_shared_from_this<Session>
|
||||
{
|
||||
beast::tcp_stream stream_;
|
||||
beast::flat_buffer buffer_;
|
||||
std::shared_ptr<std::string const> doc_root_;
|
||||
http::request<http::string_body> req_;
|
||||
|
||||
public:
|
||||
Session(
|
||||
tcp::socket&& socket,
|
||||
std::shared_ptr<std::string const> const& doc_root);
|
||||
|
||||
void Run();
|
||||
|
||||
void DoRead();
|
||||
|
||||
void OnRead(
|
||||
beast::error_code ec,
|
||||
std::size_t bytes_transferred);
|
||||
|
||||
void SendResponse(http::message_generator&& msg);
|
||||
|
||||
void OnWrite(
|
||||
bool keep_alive,
|
||||
beast::error_code ec,
|
||||
std::size_t bytes_transferred);
|
||||
|
||||
void DoClose();
|
||||
};
|
||||
}
|
27
src/content_type.h
Normal file
27
src/content_type.h
Normal file
@ -0,0 +1,27 @@
|
||||
#include <string_view>
|
||||
|
||||
namespace uad
|
||||
{
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
struct content_type
|
||||
{
|
||||
content_type() = delete;
|
||||
constexpr inline static std::string_view k_TextHtml = "text/html"sv;
|
||||
constexpr inline static std::string_view k_TextCsv = "text/csv"sv;
|
||||
constexpr inline static std::string_view k_TextPlain = "text/plain"sv;
|
||||
constexpr inline static std::string_view k_JSON = "application/json"sv;
|
||||
constexpr inline static std::string_view k_Audio = "audio/mpeg"sv;
|
||||
constexpr inline static std::string_view k_AudioExample = "audio/example"sv;
|
||||
constexpr inline static std::string_view k_FontWoff = "font/woff"sv;
|
||||
constexpr inline static std::string_view k_FontTtf = "font/ttf"sv;
|
||||
constexpr inline static std::string_view k_FontOtf = "font/otf"sv;
|
||||
constexpr inline static std::string_view k_ImagePng = "image/png"sv;
|
||||
constexpr inline static std::string_view k_ImageJpeg = "image/jpeg"sv;
|
||||
constexpr inline static std::string_view k_ImageGif = "image/gif"sv;
|
||||
constexpr inline static std::string_view k_Model = "model/vrml"sv;
|
||||
constexpr inline static std::string_view k_VideoMp4 = "video/mp4"sv;
|
||||
constexpr inline static std::string_view k_VideoWebm = "video/webm"sv;
|
||||
constexpr inline static std::string_view k_Binary = "application/octet-stream"sv;
|
||||
};
|
||||
}
|
67
src/helper.cpp
Normal file
67
src/helper.cpp
Normal file
@ -0,0 +1,67 @@
|
||||
#include "helpers.h"
|
||||
|
||||
namespace uad
|
||||
{
|
||||
beast::string_view MimeType(beast::string_view path)
|
||||
{
|
||||
using beast::iequals;
|
||||
auto const ext = [&path]
|
||||
{
|
||||
auto const pos = path.rfind(".");
|
||||
if (pos == beast::string_view::npos)
|
||||
return beast::string_view {};
|
||||
return path.substr(pos);
|
||||
}();
|
||||
if (iequals(ext, ".htm")) return "text/html";
|
||||
if (iequals(ext, ".html")) return "text/html";
|
||||
if (iequals(ext, ".php")) return "text/html";
|
||||
if (iequals(ext, ".css")) return "text/css";
|
||||
if (iequals(ext, ".txt")) return "text/plain";
|
||||
if (iequals(ext, ".js")) return "application/javascript";
|
||||
if (iequals(ext, ".json")) return "application/json";
|
||||
if (iequals(ext, ".xml")) return "application/xml";
|
||||
if (iequals(ext, ".swf")) return "application/x-shockwave-flash";
|
||||
if (iequals(ext, ".flv")) return "video/x-flv";
|
||||
if (iequals(ext, ".png")) return "image/png";
|
||||
if (iequals(ext, ".jpe")) return "image/jpeg";
|
||||
if (iequals(ext, ".jpeg")) return "image/jpeg";
|
||||
if (iequals(ext, ".jpg")) return "image/jpeg";
|
||||
if (iequals(ext, ".gif")) return "image/gif";
|
||||
if (iequals(ext, ".bmp")) return "image/bmp";
|
||||
if (iequals(ext, ".ico")) return "image/vnd.microsoft.icon";
|
||||
if (iequals(ext, ".tiff")) return "image/tiff";
|
||||
if (iequals(ext, ".tif")) return "image/tiff";
|
||||
if (iequals(ext, ".svg")) return "image/svg+xml";
|
||||
if (iequals(ext, ".svgz")) return "image/svg+xml";
|
||||
return "application/text";
|
||||
}
|
||||
|
||||
std::string PathCat(
|
||||
beast::string_view base,
|
||||
beast::string_view path)
|
||||
{
|
||||
if (base.empty())
|
||||
return std::string(path);
|
||||
std::string result(base);
|
||||
#ifdef BOOST_MSVC
|
||||
char constexpr path_separator = '\\';
|
||||
if (result.back() == path_separator)
|
||||
result.resize(result.size() - 1);
|
||||
result.append(path.data(), path.size());
|
||||
for (auto& c: result)
|
||||
if (c == '/')
|
||||
c = path_separator;
|
||||
#else
|
||||
char constexpr path_separator = '/';
|
||||
if(result.back() == path_separator)
|
||||
result.resize(result.size() - 1);
|
||||
result.append(path.data(), path.size());
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
void Fail(beast::error_code ec, char const* what)
|
||||
{
|
||||
std::cerr << what << ": " << ec.message() << "\n";
|
||||
}
|
||||
}
|
29
src/helpers.h
Normal file
29
src/helpers.h
Normal file
@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include <boost/beast/core.hpp>
|
||||
#include <boost/beast/http.hpp>
|
||||
#include <boost/beast/version.hpp>
|
||||
#include <boost/asio/dispatch.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
namespace uad
|
||||
{
|
||||
namespace beast = boost::beast;
|
||||
namespace http = beast::http;
|
||||
namespace net = boost::asio;
|
||||
|
||||
beast::string_view MimeType(beast::string_view path);
|
||||
|
||||
std::string PathCat(beast::string_view base, beast::string_view path);
|
||||
|
||||
void Fail(beast::error_code ec, char const* what);
|
||||
}
|
55
src/main.cpp
Normal file
55
src/main.cpp
Normal file
@ -0,0 +1,55 @@
|
||||
#include "sdk.h"
|
||||
|
||||
#include <boost/beast/core.hpp>
|
||||
#include <boost/asio/strand.hpp>
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
#include "RequestHandlers/BasicRequestHandler.h"
|
||||
#include "Listener.h"
|
||||
|
||||
namespace beast = boost::beast;
|
||||
namespace http = beast::http;
|
||||
namespace net = boost::asio;
|
||||
using tcp = boost::asio::ip::tcp;
|
||||
using namespace uad;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc != 5)
|
||||
{
|
||||
std::cerr <<
|
||||
"Usage: http-server-async <address> <port> <doc_root> <threads>\n" <<
|
||||
"Example:\n" <<
|
||||
" http-server-async 0.0.0.0 8080 . 1\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
auto const address = net::ip::make_address(argv[1]);
|
||||
auto const port = static_cast<unsigned short>(std::atoi(argv[2]));
|
||||
auto const doc_root = std::make_shared<std::string>(argv[3]);
|
||||
auto const threads = std::max<int>(1, std::atoi(argv[4]));
|
||||
|
||||
net::io_context ioc {threads};
|
||||
|
||||
std::make_shared<Listener>(
|
||||
ioc,
|
||||
tcp::endpoint {address, port},
|
||||
doc_root)->Run();
|
||||
|
||||
std::vector<std::thread> v;
|
||||
v.reserve(threads - 1);
|
||||
for (auto i = threads - 1; i > 0; --i)
|
||||
v.emplace_back(
|
||||
[&ioc]
|
||||
{
|
||||
ioc.run();
|
||||
});
|
||||
ioc.run();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
Reference in New Issue
Block a user