1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-13 21:51:54 +00:00
miraclecast/CMakeLists.txt

58 lines
1.6 KiB
Text
Raw Normal View History

cmake_minimum_required(VERSION 3.0.2)
2016-07-02 13:22:13 +00:00
project(Miraclecast)
2015-04-11 11:03:14 +00:00
2016-07-02 13:22:13 +00:00
SET(PACKAGE_NAME miraclecast)
SET(PACKAGE_VERSION 1)
SET(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
2015-04-11 11:03:14 +00:00
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
2015-03-08 23:06:19 +00:00
2016-06-30 11:31:31 +00:00
SET(BUILD_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
2015-04-12 08:34:42 +00:00
OPTION(BUILD_ENABLE_DEBUG "Enable Debug" ON )
OPTION(RELY_UDEV "Rely in udev tag to select device" OFF )
2015-04-12 08:34:42 +00:00
OPTION(BUILD_TESTS "Enable TEST" ON )
2017-03-22 03:12:43 +00:00
OPTION(BUILD_DEMO "Enable DEMO" OFF )
2015-04-12 08:34:42 +00:00
if(BUILD_ENABLE_DEBUG)
add_definitions(-DBUILD_ENABLE_DEBUG)
endif()
2015-04-12 08:34:42 +00:00
find_package(PkgConfig)
pkg_check_modules (GLIB2 REQUIRED glib-2.0)
pkg_check_modules (UDEV REQUIRED libudev)
pkg_check_modules (SYSTEMD REQUIRED libsystemd)
pkg_check_modules (GSTREAMER REQUIRED gstreamer-1.0)
pkg_check_modules (GSTREAMER_BASE REQUIRED gstreamer-base-1.0)
2015-03-08 23:06:19 +00:00
include(CheckCCompilerFlag)
check_c_compiler_flag(-fstack-protector-strong HAS_STACK_PROTCTOR_STRONG)
2017-03-22 03:12:43 +00:00
check_c_compiler_flag(-fsanitize=undefined HAS_SANITIZE_UNDEFINED)
if(HAS_STACK_PROTCTOR_STRONG)
set(CMAKE_C_FLAGS "-fstack-protector-strong ${CMAKE_C_FLAGS}")
endif()
if(HAS_SANITIZE_UNDEFINED)
set(CMAKE_C_FLAGS "-fsanitize=undefined ${CMAKE_C_FLAGS}")
endif()
set(CMAKE_C_FLAGS "-std=gnu11 -Wall ${CMAKE_C_FLAGS}")
add_definitions(-D_GNU_SOURCE)
if(CMAKE_COMPILER_IS_GNUCC)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
if(GCC_VERSION VERSION_LESS 4.9)
message(FATAL_ERROR "gcc >= 4.9 is requred")
endif()
endif()
2016-07-02 13:22:13 +00:00
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
add_subdirectory(src)
add_subdirectory(res)
add_subdirectory(test)
2015-03-08 23:06:19 +00:00
2017-03-22 03:12:43 +00:00
if(BUILD_DEMO)
add_subdirectory(demo)
endif()