-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
47 lines (35 loc) · 1.84 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
cmake_minimum_required(VERSION 2.6)
project(liblogicalaccess-libnfc)
# Perform Conan basic setup to import targets etc
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
include(GenerateExportHeader)
# COPY PASTED FROM LLA MAIN REPO
macro(LLA_GENERATE_EXPORTS)
string(TOLOWER ${ARGV0} _LOWERCASE_LIB_NAME)
set(_EXPORT_FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${_LOWERCASE_LIB_NAME}_api.hpp")
generate_export_header(${PROJECT_NAME}
EXPORT_MACRO_NAME "${ARGV0}_API"
EXPORT_FILE_NAME ${_EXPORT_FILE_PATH})
target_compile_definitions(${PROJECT_NAME} PRIVATE "${_LOWERCASE_LIB_NAME}_EXPORTS=1")
if (MSVC)
target_compile_options(${PROJECT_NAME} PUBLIC "/wd4251")
endif ()
# HEADER_INSTALL_DIR must be defined before calling the macro.
install(FILES ${_EXPORT_FILE_PATH} DESTINATION ${HEADER_RELATIVE_INSTALL_DIR})
endmacro()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(CXX11 REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAGS}")
if (MSVC)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
SET(VERSION_PRODUCTNAME_VALUE "Liblogicalaccess")
SET(VERSION_PROJECT_FILE_DESCRIPTION_VALUE "${VERSION_PRODUCTNAME_VALUE}\ (${TARGET_ARCH})")
add_definitions(-DVERSION_PROJECT_FILE_DESCRIPTION_VALUE="${VERSION_PROJECT_FILE_DESCRIPTION_VALUE}" -DVERSION_FILE_AND_PRODUCT_VALUE_STRING="${LIBLOGICALACCESS_VERSION_STRING}" -DVERSION_FILE_AND_PRODUCT_VALUE=${LIBLOGICALACCESS_WINDOWS_VERSION})
file(GLOB LLA_RESOURCE_RC ${CMAKE_CURRENT_SOURCE_DIR}/vc++/resource.rc)
endif ()
add_subdirectory(plugins/logicalaccess/plugins/readers)
if (NOT DEFINED SYSCONF_INSTALL_DIR)
set(SYSCONF_INSTALL_DIR etc)
endif ()