forked from tuputech/tupu-cpp-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
54 lines (41 loc) · 1.58 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
###############################################################################
# TUPU Recognition API SDK
# Copyright(c)2013-2016, TUPU Technology
# http://www.tuputech.com
###############################################################################
cmake_minimum_required (VERSION 2.8)
project (Demo1)
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_ROOT_PATH "/usr/local/Cellar/openssl/1.0.2o_2") # default OPENSSL_ROOT_PATH, need change
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_PATH}/include")
find_package(OpenSSL)
find_package(CURL)
if (debug AND 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)