File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.10.2 )
22project (TgBot)
33
4+ if (POLICY CMP0074)
5+ cmake_policy (SET CMP0074 NEW ) # find_package() uses <PackageName>_ROOT variables
6+ endif ()
7+
48# options
59option (ENABLE_TESTS "Set to ON to enable building of tests" OFF )
610option (BUILD_SHARED_LIBS "Build tgbot-cpp shared/static library." OFF )
@@ -12,6 +16,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
1216set (CMAKE_CXX_EXTENSIONS OFF )
1317if (WIN32 )
1418 set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON )
19+ add_definitions (-D_WIN32_WINNT=0x0601 )
20+ add_definitions (-DWIN32_LEAN_AND_MEAN )
21+ add_definitions (-DNOMINMAX )
1522else ()
1623 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
1724endif ()
@@ -75,9 +82,12 @@ set(LIB_LIST
7582 ${ZLIB_LIBRARIES}
7683 ${OPENSSL_LIBRARIES}
7784 ${Boost_LIBRARIES}
78- ${CURL_LIBRARIES}
7985)
8086
87+ if (CURL_FOUND)
88+ set (LIB_LIST ${LIB_LIST} ${CURL_LIBRARIES} )
89+ endif ()
90+
8191# building project
8292add_library (${PROJECT_NAME} ${SRC_LIST} )
8393target_include_directories (${PROJECT_NAME} PUBLIC include )
You can’t perform that action at this time.
0 commit comments