-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
61 lines (48 loc) · 1.79 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
###############################################################################
# TUPU Recognition API SDK
# Copyright(c)2013-2022, TUPU Technology
# http://www.tuputech.com
###############################################################################
cmake_minimum_required (VERSION 3.4)
project (tupu-sdk VERSION 1.5.0 DESCRIPTION "TUPU SDK for image detection")
set(debug 0) #default not print debug info, no debug symbol
if (debug)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
message(STATUS ${CMAKE_SYSTEM_NAME})
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
endif ()
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_MACOSX_RPATH 1)
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused-function -std=c++11")
set(OPENSSL_USE_STATIC_LIBS TRUE)
find_package(OpenSSL REQUIRED)
find_package(CURL REQUIRED)
if (OPENSSL_FOUND)
message(STATUS "${OPENSSL_INCLUDE_DIR}")
message(STATUS "${OPENSSL_CRYPTO_LIBRARY}")
message(STATUS "${OPENSSL_SSL_LIBRARY}")
message(STATUS "${OPENSSL_LIBRARIES}")
message(STATUS "${OPENSSL_VERSION}")
endif ()
#if (debug AND CURL_FOUND)
if (CURL_FOUND)
message(STATUS "${CURL_INCLUDE_DIRS}")
message(STATUS "${CURL_LIBRARIES}")
message(STATUS "${CURL_VERSION_STRING}")
endif ()
if(${CURL_VERSION_STRING} STRLESS "7.56.0") # MIME API supported, curl_formadd is deprecated.
message(FATAL_ERROR "curl version neeed at least 7.56.0")
endif()
include_directories(
${OPENSSL_INCLUDE_DIR}
${CURL_INCLUDE_DIRS}
${PROJECT_SOURCE_DIR}/include
)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_subdirectory(src)
add_subdirectory(test)