forked from nfc-tools/libfreefare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (40 loc) · 1.68 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
project(libfreefare C)
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
add_definitions("-std=c99")
find_package(LIBNFC REQUIRED)
find_package(OpenSSL REQUIRED)
IF(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config_windows.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/contrib/win32)
find_library(WINSOCK_LIB libws2_32.a)
set(LIBS ${LIBS} ${WINSOCK_LIB})
ENDIF(WIN32)
if(MINGW)
# force MinGW-w64 in 32bit mode
add_definitions("-m32")
set(CMAKE_SHARED_LINKER_FLAGS -m32)
set(CMAKE_EXE_LINKER_FLAGS -m32)
endif(MINGW)
message("CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS})
message("CMAKE_SHARED_LINKER_FLAGS: " ${CMAKE_SHARED_LINKER_FLAGS})
include_directories(${LIBNFC_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/contrib/libutil)
set(LIBS ${LIBS} ${LIBNFC_LIBRARIES} ${OPENSSL_LIBRARIES})
option(WITH_DEBUG "Extra debug information is outputted when this is turned on" OFF)
if(DEFINED CMAKE_INSTALL_LIBDIR)
set(libdir ${CMAKE_INSTALL_LIBDIR})
else(DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR lib)
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
endif(DEFINED CMAKE_INSTALL_LIBDIR)
if(DEFINED INCLUDE_INSTALL_DIR)
set(includedir ${INCLUDE_INSTALL_DIR})
else(DEFINED INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR include)
set(includedir ${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR})
endif(DEFINED INCLUDE_INSTALL_DIR)
if(NOT DEFINED SHARE_INSTALL_PREFIX)
set(SHARE_INSTALL_PREFIX share)
endif(NOT DEFINED SHARE_INSTALL_PREFIX)
add_subdirectory(libfreefare)
add_subdirectory(examples)