Mentions légales du service

Skip to content
Snippets Groups Projects
CMakeLists.txt 1.01 KiB
Newer Older
Mattéo Delabre's avatar
Mattéo Delabre committed
cmake_minimum_required(VERSION 3.4)
Mattéo Delabre's avatar
Mattéo Delabre committed
project(rmvncclient)
Mattéo Delabre's avatar
Mattéo Delabre committed
option(CHECK_INCLUDES "Run include-what-you-use to check #includes" OFF)
option(TRACE "Print tracing messages on standard output" OFF)

if(CHECK_INCLUDES)
    find_program(IWYU_PATH include-what-you-use)

    if(NOT IWYU_PATH)
        message(FATAL_ERROR "Could not find include-what-you-use")
    endif()
Mattéo Delabre's avatar
Mattéo Delabre committed
    set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH})
endif()

if(TRACE)
Mattéo Delabre's avatar
Mattéo Delabre committed
    message(STATUS "Trace mode enabled")
    add_definitions(-DTRACE)
Mattéo Delabre's avatar
Mattéo Delabre committed
endif()

# Find dependencies
find_package(PkgConfig REQUIRED)
pkg_check_modules(VNCCLIENT REQUIRED IMPORTED_TARGET libvncclient)
set_property(TARGET PkgConfig::VNCCLIENT PROPERTY
    INTERFACE_LINK_LIBRARIES "${VNCCLIENT_STATIC_LIBRARIES}")
Mattéo Delabre's avatar
Mattéo Delabre committed
add_executable(rmvncclient
    src/rmioc/input.cpp
    src/rmioc/screen.cpp
    src/client.cpp
    src/client-input.cpp
    src/client-screen.cpp
Mattéo Delabre's avatar
Mattéo Delabre committed
    src/main.cpp
Mattéo Delabre's avatar
Mattéo Delabre committed
)

set_property(TARGET rmvncclient PROPERTY CXX_STANDARD 17)

Mattéo Delabre's avatar
Mattéo Delabre committed
target_link_libraries(rmvncclient PUBLIC PkgConfig::VNCCLIENT)