2018-05-29 08:08:26 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
project(looking-glass-client C)
|
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
|
|
|
|
|
2018-05-31 08:54:10 +00:00
|
|
|
SET(CMAKE_C_FLAGS "-std=gnu99 -g -O3 -march=native -Wall -Werror -Wfatal-errors -ffast-math -fdata-sections -ffunction-sections")
|
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--gc-sections")
|
2018-05-29 08:08:26 +00:00
|
|
|
|
|
|
|
find_package(PkgConfig)
|
|
|
|
pkg_check_modules(PKGCONFIG REQUIRED
|
|
|
|
sdl2
|
|
|
|
SDL2_ttf
|
|
|
|
gl
|
|
|
|
glu
|
2018-09-22 06:26:10 +00:00
|
|
|
egl
|
2018-05-29 08:08:26 +00:00
|
|
|
spice-protocol
|
|
|
|
fontconfig
|
|
|
|
x11
|
|
|
|
libconfig
|
|
|
|
nettle
|
|
|
|
hogweed
|
|
|
|
)
|
|
|
|
|
|
|
|
execute_process(
|
|
|
|
COMMAND git describe --always --long --dirty --abbrev=10 --tags
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE BUILD_VERSION
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
|
|
|
|
find_package(GMP)
|
|
|
|
|
|
|
|
add_definitions(-D BUILD_VERSION='"${BUILD_VERSION}"')
|
|
|
|
add_definitions(-D USE_NETTLE)
|
2018-05-29 08:18:22 +00:00
|
|
|
add_definitions(-D ATOMIC_LOCKING)
|
2018-05-29 08:08:26 +00:00
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${PROJECT_SOURCE_DIR}
|
|
|
|
${PROJECT_SOURCE_DIR}/../common
|
|
|
|
${PKGCONFIG_INCLUDE_DIRS}
|
|
|
|
${GMP_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
link_libraries(
|
|
|
|
${PKGCONFIG_LIBRARIES}
|
|
|
|
${GMP_LIBRARIES}
|
|
|
|
rt m
|
|
|
|
)
|
|
|
|
|
|
|
|
set(SOURCES
|
|
|
|
main.c
|
|
|
|
lg-renderer.c
|
2018-11-19 22:50:09 +00:00
|
|
|
lg-fonts.c
|
2018-05-29 08:08:26 +00:00
|
|
|
ll.c
|
2018-09-22 06:26:10 +00:00
|
|
|
utils.c
|
2018-05-29 08:08:26 +00:00
|
|
|
spice/rsa.c
|
|
|
|
spice/spice.c
|
|
|
|
decoders/null.c
|
2018-07-27 22:41:15 +00:00
|
|
|
decoders/yuv420.c
|
2018-05-29 08:08:26 +00:00
|
|
|
renderers/opengl.c
|
2018-09-22 06:26:10 +00:00
|
|
|
renderers/egl.c
|
|
|
|
renderers/egl_shader.c
|
2018-09-23 05:48:44 +00:00
|
|
|
renderers/egl_texture.c
|
2018-11-19 22:50:09 +00:00
|
|
|
renderers/egl_model.c
|
2018-11-19 17:38:11 +00:00
|
|
|
fonts/sdl.c
|
2018-05-29 08:08:26 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(looking-glass-client ${SOURCES})
|
|
|
|
target_compile_options(looking-glass-client PUBLIC ${PKGCONFIG_CFLAGS_OTHER})
|