-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
60 lines (50 loc) · 1.37 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
#
# Author: <[email protected]>
# created: 2014-08-27
PROJECT(iShare)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
MESSAGE(STATUS "Project: ${PROJECT_NAME}")
MESSAGE(STATUS "Project Directory: ${PORJECT_SOURCE_DIR}")
message(status ${source})
file(GLOB_RECURSE header ${iShare_SOURCE_DIR}/iShare_source/*.h
${iShare_SOURCE_DIR}/MMGAPN/*.hpp)
file(GLOB_RECURSE source ${iShare_SOURCE_DIR}/iShare_source/*.cc
${iShare_SOURCE_DIR}/MMGAPN/*.cpp)
list(REMOVE_ITEM source ${iShare_SOURCE_DIR}/MMGAPN/feedback.cpp ${iShare_SOURCE_DIR}/MMGAPN/main.cpp)
SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_CXX_FLAGS "-std=c++11")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
include_directories(
/usr/local/mysql/include/
/usr/local/mysql/lib/
/usr/include/mysql
)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
/lib
/usr/lib
/usr/lib64
/usr/local/lib
/usr/local/lib64
/usr/lib/x86_64-linux-gnu
/usr/local/mysql-5.6.25-osx10.8-x86_64/lib/
/usr/lib/x86_64-linux-gnu)
add_executable(iShare ${source})
find_library(MYSQL_CLIENT NAMES libmysqlclient.a)
if(MYSQL_CLIENT)
message(STATUS ${MYSQL_CLIENT})
target_link_libraries(iShare
grpc++_reflection
protobuf
grpc++
grpc
pthread
${MYSQL_CLIENT}
dl
z
ssl
crypto
)
else()
message(FATAL_ERROR "FATAL ERROR: missing library")
endif()