cmake_minimum_required(VERSION 2.6) project(libtorrent) set(sources alert allocator assert bandwidth_limit bandwidth_manager bandwidth_queue_entry connection_queue create_torrent disk_buffer_holder entry error_code file_storage lazy_bdecode escape_string file gzip http_connection http_stream http_parser i2p_stream identify_client ip_filter peer_connection bt_peer_connection web_peer_connection http_seed_connection instantiate_connection natpmp piece_picker policy session session_impl socket_io socket_type socks5_stream stat storage time torrent torrent_handle torrent_info tracker_manager http_tracker_connection udp_tracker_connection udp_socket upnp logger file_pool lsd disk_io_thread enum_net broadcast_socket magnet_uri parse_url ConvertUTF # -- extensions -- metadata_transfer ut_pex ut_metadata smart_ban lt_trackers ) # -- kademlia -- set(kademlia_sources dht_tracker node refresh rpc_manager find_data node_id routing_table traversal_algorithm ) set(zlib_sources adler32 compress crc32 deflate gzio infback inffast inflate inftrees trees uncompr zutil ) set(includes include zlib) option(shared "build libtorrent as a shared library" ON) option(tcmalloc "link against google performance tools tcmalloc" OFF) option(pool-allocators "Uses a pool allocator for disk and piece buffers" ON) option(encryption "link against openssl and enable encryption" ON) option(geoip "link against LGPL GeoIP code from Maxmind, to enable geoip database support" OFF) option(dht "enable support for Mainline DHT" ON) option(resolve-countries "enable support for resolving countries from peer IPs" ON) option(unicode "enable unicode support" ON) option(deprecated-functions "enable deprecated functions for backwards compatibility" ON) option(exceptions "build with exception support" ON) option(logging "build with logging" OFF) option(verbose-logging "build with verbose logging" OFF) option(build_tests "build tests" OFF) option(build_examples "build examples" OFF) set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release FORCE) endif (NOT CMAKE_BUILD_TYPE) # add_definitions() doesn't seem to let you say wich build type to apply it to set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DTORRENT_DEBUG") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os -g") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") if (encryption) list(APPEND sources pe_crypto) endif (encryption) if (logging) add_definitions(-DTORRENT_LOGGING) endif (logging) if (verbose-logging) add_definitions(-DTORRENT_VERBOSE_LOGGING) endif (verbose-logging) foreach(s ${sources}) list(APPEND sources2 src/${s}) endforeach(s) foreach(s ${zlib_sources}) list(APPEND zlib_sources2 zlib/${s}) endforeach(s) if (dht) foreach(s ${kademlia_sources}) list(APPEND sources2 src/kademlia/${s}) endforeach(s) else (dht) add_definitions(-DTORRENT_DISABLE_DHT) endif (dht) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") if (shared) add_library(torrent-rasterbar SHARED ${sources2} ${zlib_sources2}) else (shared) add_library(torrent-rasterbar STATIC ${sources2} ${zlib_sources2}) endif (shared) FIND_PACKAGE( Boost 1.34 COMPONENTS filesystem) if (NOT Boost_VERSION LESS 103500) FIND_PACKAGE( Boost 1.35 COMPONENTS filesystem system) endif (NOT Boost_VEHTTP/1.1 200 OK Cache-Control: public, max-age=21600, no-transform Content-Disposition: inline; filename="CMakeLists.txt"; filename*=UTF-8''CMakeLists.txt Content-Length: 7439 Etag: "7556cb3e73ef0e9a28bafcad6019dcfd4d2237ea" Set-Cookie: i_like_gitea=8b68bbebc95d36f0; Path=/; HttpOnly; Secure; SameSite=Lax Set-Cookie: _csrf=OIhWJnQSiD258wEsHaUf4aqZj9o6MTc1MzI5ODcwNTI0Nzk5MDQxNA; Path=/; Max-Age=86400; HttpOnly; Secure; SameSite=Lax X-Content-Type-Options: nosniff Content-Type: text/plain; charset=utf-8 Connection: close Access-Control-Expose-Headers: Content-Disposition Date: Wed, 23 Jul 2025 19:25:05 GMT Last-Modified: Sat, 05 Dec 2009 16:50:07 GMT X-Frame-Options: SAMEORIGIN X-Cache-Status: HIT X-Cache-Age: 0 cmake_minimum_required(VERSION 2.6) project(libtorrent) set(sources alert allocator assert bandwidth_limit bandwidth_manager bandwidth_queue_entry connection_queue create_torrent disk_buffer_holder entry error_code file_storage lazy_bdecode escape_string file gzip http_connection http_stream http_parser i2p_stream identify_client ip_filter peer_connection bt_peer_connection web_peer_connection http_seed_connection instantiate_connection natpmp piece_picker policy session session_impl socket_io socket_type socks5_stream stat storage time torrent torrent_handle torrent_info tracker_manager http_tracker_connection udp_tracker_connection udp_socket upnp logger file_pool lsd disk_io_thread enum_net broadcast_socket magnet_uri parse_url ConvertUTF # -- extensions -- metadata_transfer ut_pex ut_metadata smart_ban lt_trackers ) # -- kademlia -- set(kademlia_sources dht_tracker node refresh rpc_manager find_data node_id routing_table traversal_algorithm ) set(zlib_sources adler32 compress crc32 deflate gzio infback inffast inflate inftrees trees uncompr zutil ) set(includes include zlib) option(shared "build libtorrent as a shared library" ON) option(tcmalloc "link against google performance tools tcmalloc" OFF) option(pool-allocators "Uses a pool allocator for disk and piece buffers" ON) option(encryption "link against openssl and enable encryption" ON) option(geoip "link against LGPL GeoIP code from Maxmind, to enable geoip database support" OFF) option(dht "enable support for Mainline DHT" ON) option(resolve-countries "enable support for resolving countries from peer IPs" ON) option(unicode "enable unicode support" ON) option(deprecated-functions "enable deprecated functions for backwards compatibility" ON) option(exceptions "build with exception support" ON) option(logging "build with logging" OFF) option(verbose-logging "build with verbose logging" OFF) option(build_tests "build tests" OFF) option(build_examples "build examples" OFF) set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo) if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release FORCE) endif (NOT CMAKE_BUILD_TYPE) # add_definitions() doesn't seem to let you say wich build type to apply it to set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DTORRENT_DEBUG") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os -g") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") if (encryption) list(APPEND sources pe_crypto) endif (encryption) if (logging) add_definitions(-DTORRENT_LOGGING) endif (logging) if (verbose-logging) add_definitions(-DTORRENT_VERBOSE_LOGGING) endif (verbose-logging) foreach(s ${sources}) list(APPEND sources2 src/${s}) endforeach(s) foreach(s ${zlib_sources}) list(APPEND zlib_sources2 zlib/${s}) endforeach(s) if (dht) foreach(s ${kademlia_sources}) list(APPEND sources2 src/kademlia/${s}) endforeach(s) else (dht) add_definitions(-DTORRENT_DISABLE_DHT) endif (dht) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") if (shared) add_library(torrent-rasterbar SHARED ${sources2} ${zlib_sources2}) else (shared) add_library(torrent-rasterbar STATIC ${sources2} ${zlib_sources2}) endif (shared) FIND_PACKAGE( Boost 1.34 COMPONENTS filesystem) if (NOT Boost_VERSION