-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
71 lines (59 loc) · 1.59 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
62
63
64
65
66
67
68
69
70
PROJECT(devrecog-sample C)
SET(CMAKE_C_STANDARD 90)
# arm64 still not supported
SET(CMAKE_OSX_ARCHITECTURES x86_64)
CMAKE_MINIMUM_REQUIRED(VERSION 3.3.1)
SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")
IF (CMAKE_BUILD_TYPE MATCHES DEBUG)
MESSAGE(STATUS "Debug mode")
SET(CMAKE_VERBOSE_MAKEFILE ON)
ENDIF()
# Cmake Policies
IF(NOT CMAKE_VERSION VERSION_LESS 3.9.0)
CMAKE_POLICY(SET CMP0068 OLD)
ENDIF()
# Variables
IF (NOT DEFINED C_EXECUTABLE)
SET(C_EXECUTABLE devrecog-c)
ENDIF()
IF (NOT DEFINED CPP_EXECUTABLE)
SET(CPP_EXECUTABLE devrecog-cpp)
ENDIF()
IF (NOT DEFINED CS_EXECUTABLE)
SET(CS_EXECUTABLE devrecog-cs)
ENDIF()
SET(LIB_DIR ${CMAKE_SOURCE_DIR}/lib)
SET(INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
# OS Specific
IF (WIN32)
ELSEIF(APPLE)
SET(LIBFINGKIT ${LIB_DIR}/libfingkit.dylib)
ELSE()
SET(LIBFINGKIT ${LIB_DIR}/libfingkit.so)
LINK_DIRECTORIES(${LIB_DIR})
ENDIF()
# Include
INCLUDE_DIRECTORIES(${INCLUDE_DIR})
# Libraries
LINK_DIRECTORIES(${LIB_DIR})
# Sources
# -> C
ADD_EXECUTABLE(${C_EXECUTABLE} src/fing_kit_demo.c)
TARGET_LINK_LIBRARIES(${C_EXECUTABLE} ${LIBFINGKIT})
# -> C++
if(CMAKE_CXX_COMPILER)
ENABLE_LANGUAGE(CXX)
SET(CMAKE_CXX_STANDARD 98)
ADD_EXECUTABLE(${CPP_EXECUTABLE} src/fing_kit_demo.cpp)
TARGET_LINK_LIBRARIES(${CPP_EXECUTABLE} ${LIBFINGKIT})
else()
MESSAGE(STATUS "No C++ support")
endif()
# -> CS
if(CMAKE_CSharp_COMPILER)
ENABLE_LANGUAGE(CSharp)
ADD_EXECUTABLE(${CS_EXECUTABLE} src/fing_kit_demo.cs)
TARGET_LINK_LIBRARIES(${CS_EXECUTABLE} ${LIBFINGKIT})
else()
MESSAGE(STATUS "No C# support")
endif()