Skip to content

Commit 7fb7f87

Browse files
committed
Modify CMakeList to support the new version of boost
1 parent f52c0b8 commit 7fb7f87

1 file changed

Lines changed: 24 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,35 @@ endif()
7070
## boost
7171
set(Boost_USE_MULTITHREADED ON)
7272
if (ENABLE_TESTS)
73-
find_package(Boost 1.65.1 COMPONENTS system unit_test_framework REQUIRED)
73+
find_package(Boost 1.65.1 REQUIRED COMPONENTS unit_test_framework)
7474
else()
75-
find_package(Boost 1.65.1 COMPONENTS system REQUIRED)
75+
find_package(Boost 1.65.1 REQUIRED)
7676
endif()
77+
78+
# Check if Boost::system target exists (compatible with new and old versions)
79+
if(TARGET Boost::system)
80+
set(BOOST_SYSTEM_TARGET Boost::system)
81+
message(STATUS "Using Boost::system target")
82+
else()
83+
set(BOOST_SYSTEM_TARGET "")
84+
message(STATUS "Boost::system not available, using header-only")
85+
endif()
86+
7787
include_directories(${Boost_INCLUDE_DIR})
7888
link_directories(${Boost_LIBRARY_DIR_RELEASE})
7989
if(NOT Boost_USE_STATIC_LIBS)
8090
add_definitions(-DBOOST_ALL_DYN_LINK)
8191
endif()
8292
add_definitions(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
8393

94+
set(LIB_LIST
95+
${CMAKE_THREAD_LIBS_INIT}
96+
${ZLIB_LIBRARIES}
97+
${OPENSSL_LIBRARIES}
98+
${Boost_LIBRARIES}
99+
${BOOST_SYSTEM_TARGET}
100+
)
101+
84102
set(LIB_LIST
85103
${CMAKE_THREAD_LIBS_INIT}
86104
${ZLIB_LIBRARIES}
@@ -124,6 +142,10 @@ if (ENABLE_TESTS)
124142
enable_testing()
125143
add_subdirectory(test)
126144
endif()
145+
#add_subdirectory(samples/echobot-webhook-server)
146+
#add_subdirectory(samples/inline-keyboard)
147+
#add_subdirectory(samples/reply-keyboard)
148+
127149

128150
# Documentation
129151
if(BUILD_DOCUMENTATION)

0 commit comments

Comments
 (0)