File: CMakeLists.txt

package info (click to toggle)
libfreefare 0.4.0-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 952 kB
  • sloc: ansic: 10,581; makefile: 332; sh: 8
file content (53 lines) | stat: -rw-r--r-- 1,728 bytes parent folder | download | duplicates (2)
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
# $Id$
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)