cmake_minimum_required(VERSION 2.6)

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")

include_directories(/opt/vc/include)
include_directories(/opt/vc/include/interface/vcos/pthreads)
include_directories(/opt/vc/include/interface/vmcs_host)
include_directories(/opt/vc/include/interface/vmcs_host/linux)

link_directories(/opt/vc/lib)

add_executable(raspi2fb raspi2fb.c syslogUtilities.c)

target_link_libraries(raspi2fb bcm_host bsd)

set_property(TARGET raspi2fb PROPERTY SKIP_BUILD_RPATH TRUE)
install (TARGETS raspi2fb RUNTIME DESTINATION bin)

cmake_minimum_required(VERSION 2.6)
project(raspi2fb)

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")

find_package(PkgConfig)
pkg_check_modules(EGL egl)
pkg_check_modules(LIBBSD libbsd)

include_directories(${EGL_INCLUDE_DIRS} ${LIBBSD_INCLUDE_DIRS})
link_directories(${EGL_LIBRARY_DIRS} ${LIBBSD_LIBRARY_DIRS})

add_executable(${PROJECT_NAME} raspi2fb.c syslogUtilities.c)

target_link_libraries(${PROJECT_NAME} ${EGL_LIBRARIES} ${LIBBSD_LIBRARIES})

set_property(TARGET ${PROJECT_NAME} PROPERTY SKIP_BUILD_RPATH TRUE)
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)

Add pkg-config for libbsd and egl.
Add pkg-config for libbsd and egl.

Signed-off-by: Julien Gueytat <1a73af9e7ae00182733b2292511b814be66f065f@jgueytat.fr>
