-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathCMakeLists.txt
49 lines (37 loc) · 1.51 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
cmake_minimum_required(VERSION 3.1.0)
project(EventSender)
# Uncomment for building i386 binary on x86_64 system
#set(CMAKE_SYSTEM_PROCESSOR i386)
# For ARM / Raspberry Pi 3 cross-compile
# set(MAT_SDK_LIB /usr/local/lib/armv7l-linux-gnu)
# Point example to SDK dirs for x86_64 Desktop
if(EXISTS "/usr/local/lib/libmat.a")
# Use local libmat.a
set(MAT_SDK_LIB /usr/local/lib/)
else()
# Use architecture-specific libmat.a
set(MAT_SDK_LIB /usr/local/lib/${CMAKE_SYSTEM_PROCESSOR}-linux-gnu)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -ggdb -gdwarf-2 -std=c11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -ggdb -gdwarf-2 -std=c++11")
find_package (Threads)
set(MAT_SDK_INCLUDE /usr/local/include/mat)
# 1DS SDK to include dirs
include_directories( . ${MAT_SDK_INCLUDE} )
# Link main.cpp to executable
add_executable(EventSender EventSender.cpp)
source_group(" " REGULAR_EXPRESSION "")
# Prefer linking to more recent local sqlite3
if(EXISTS "/usr/local/lib/libsqlite3.a")
set (SQLITE3_LIB "/usr/local/lib/libsqlite3.a")
else()
set (SQLITE3_LIB "sqlite3")
endif()
set (PLATFORM_LIBS "")
# Add flags for obtaining system UUID via IOKit
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set (PLATFORM_LIBS "-framework CoreFoundation -framework IOKit")
endif()
#tcmalloc turned off by default
#target_link_libraries(EventSender ${MAT_SDK_LIB}/libmat.a curl z ${CMAKE_THREAD_LIBS_INIT} ${SQLITE3_LIB} dl tcmalloc)
target_link_libraries(EventSender ${MAT_SDK_LIB}/libmat.a curl z ${CMAKE_THREAD_LIBS_INIT} ${SQLITE3_LIB} ${PLATFORM_LIBS} dl)