wlgol/CMakeLists.txt

63 lines
1.6 KiB
CMake
Raw Normal View History

2024-11-02 18:37:10 +01:00
cmake_minimum_required(VERSION 3.10 )
2024-06-02 19:29:26 +02:00
set(CMAKE_C_STANDARD 11)
project(wlgol
2024-06-02 19:29:26 +02:00
VERSION 0.0.1
DESCRIPTION "Wayland Game Of Life"
LANGUAGES C)
2024-06-02 19:29:26 +02:00
# Download xdg-shell.xml
# file(DOWNLOAD "https://cgit.freedesktop.org/wayland/wayland-protocols/plain/stable/xdg-shell/xdg-shell.xml" "${CMAKE_CURRENT_BINARY_DIR}/xdg-shell.xml")
# Generation of xdg-shell.h and xdg-shell.c
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/include/xdg-shell.h
COMMAND wayland-scanner client-header ${CMAKE_SOURCE_DIR}/xdg-shell.xml ${CMAKE_CURRENT_BINARY_DIR}/include/xdg-shell.h
DEPENDS ${CMAKE_SOURCE_DIR}/xdg-shell.xml
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell.c
COMMAND wayland-scanner private-code ${CMAKE_SOURCE_DIR}/xdg-shell.xml ${CMAKE_CURRENT_BINARY_DIR}/xdg-shell.c
DEPENDS ${CMAKE_SOURCE_DIR}/xdg-shell.xml
)
set(SOURCES
tkeyboard.c
2024-06-02 19:29:26 +02:00
tpointer.c
2024-06-29 23:18:00 +02:00
hashtable.c
2024-06-02 19:29:26 +02:00
${CMAKE_CURRENT_BINARY_DIR}/xdg-shell.c
)
set(GENHEADERS
${CMAKE_CURRENT_BINARY_DIR}/include/xdg-shell.h
)
2024-11-02 18:37:10 +01:00
add_executable(wlgol wlgol.c ${SOURCES} ${GENHEADERS})
2024-06-02 19:29:26 +02:00
target_include_directories(wlgol
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
)
2024-06-02 19:29:26 +02:00
target_link_libraries(wlgol
wayland-client
wayland-cursor
)
2024-11-02 18:37:10 +01:00
add_executable(test_hashtable tests/test_hashtable.c
${SOURCES}
)
target_link_libraries(test_hashtable
wayland-client
wayland-cursor
)
target_include_directories(test_hashtable
PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/include
PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include
)
enable_testing()
add_test(NAME Hashtable COMMAND test_hashtable)