File: CMakeLists.txt

package info (click to toggle)
libfreesrp 0.3.0-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 496 kB
  • sloc: cpp: 3,755; makefile: 2
file content (67 lines) | stat: -rw-r--r-- 1,979 bytes parent folder | download
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
cmake_minimum_required(VERSION 2.8.4)
project(libfreesrp)
include(GNUInstallDirs)

set(VERSION_MAJOR "0")
set(VERSION_MINOR "3")
set(VERSION_PATCH "0")
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/modules")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

# FreeSRP Library
find_package(libusb-1.0 REQUIRED)

include_directories(${LIBUSB_1_INCLUDE_DIR})

file(GLOB_RECURSE LIBFREESRP_SRC_FILES
    ${PROJECT_SOURCE_DIR}/src/*.hpp
    ${PROJECT_SOURCE_DIR}/src/*.cpp
)

file(GLOB_RECURSE LIBFREESRP_INCLUDE_FILES
    ${PROJECT_SOURCE_DIR}/include/*.hpp
)

file(GLOB_RECURSE READERWRITERQUEUE_INCLUDE_FILES
    ${PROJECT_SOURCE_DIR}/src/readerwriterqueue/*.h
)

add_library(
    freesrp
    SHARED
    ${LIBFREESRP_SRC_FILES}
    ${LIBFREESRP_INCLUDE_FILES}
)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    message("-- WARNING: Configured in DEBUG mode. This will *very heavily* impact performance!")
endif()

set_target_properties(freesrp PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_MAJOR})
target_link_libraries(freesrp ${LIBUSB_1_LIBRARIES})

# Examples
include_directories(${PROJECT_SOURCE_DIR}/include)

# freesrp-io, using callbacks instead of busy waiting
set(EXAMPLE_TEST_SOURCE_FILES ${PROJECT_SOURCE_DIR}/examples/io/main.cpp)
add_executable(freesrp-io ${EXAMPLE_TEST_SOURCE_FILES})
target_link_libraries(freesrp-io freesrp pthread)

# freesrp-ctl
file(GLOB_RECURSE FREESRP_CTL_FILES
    ${PROJECT_SOURCE_DIR}/examples/ctl/*.hpp
    ${PROJECT_SOURCE_DIR}/examples/ctl/*.cpp
)
add_executable(freesrp-ctl ${FREESRP_CTL_FILES})
target_link_libraries(freesrp-ctl freesrp)

# Install library
install(TARGETS freesrp LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(FILES ${LIBFREESRP_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# Install freesrp-ctl and freesrp-io utilities
install(TARGETS freesrp-ctl freesrp-io RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})