aswm/CMakeLists.txt

64 lines
1.5 KiB
CMake
Raw Permalink Normal View History

cmake_minimum_required(VERSION 3.21)
project(aswm)
set(CMAKE_C_STANDARD 23)
find_package(X11 REQUIRED)
2024-12-29 12:51:11 +00:00
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -pg")
2024-12-15 13:45:02 +00:00
2025-02-01 10:10:56 +00:00
include(FetchContent)
FetchContent_Declare(
unity
GIT_REPOSITORY https://github.com/ThrowTheSwitch/Unity.git
GIT_TAG v2.6.1
)
FetchContent_Declare(
zlog
GIT_REPOSITORY https://github.com/HardySimpson/zlog.git
GIT_TAG 1.2.18
)
FetchContent_Declare(
argparse
GIT_REPOSITORY https://github.com/cofyc/argparse.git
GIT_TAG 682d4520b4bc2b646cdfcf078b2fed00b3d2da30
)
FetchContent_MakeAvailable(unity zlog argparse)
2025-01-18 09:20:49 +00:00
add_library(libaswm
2024-12-15 14:24:29 +00:00
src/aswm/aswm.c
src/aswm/mapper/mapper.c
2024-12-15 14:09:18 +00:00
src/aswm/event_handlers/create.c
src/aswm/event_handlers/configure.c
src/aswm/event_handlers/reparent.c
src/aswm/event_handlers/destroy.c
src/aswm/event_handlers/map.c
2024-12-29 12:51:11 +00:00
src/aswm/event_handlers/unmap.c
src/aswm/event_handlers/property.c
src/aswm/event_handlers/message.c
2024-12-29 12:51:11 +00:00
src/aswm/log/log.c
)
2025-02-01 10:10:56 +00:00
target_include_directories(libaswm PUBLIC ${X11_INCLUDE_DIR} src
${zlog_SOURCE_DIR}/src)
target_link_libraries(libaswm ${X11_LIBRARIES} zlog)
2025-01-18 09:20:49 +00:00
2025-02-01 10:10:56 +00:00
add_executable(aswm src/aswm/main.c ${argparse_SOURCE_DIR}/argparse.c)
target_include_directories(aswm PUBLIC ${argparse_SOURCE_DIR})
2025-01-18 09:20:49 +00:00
target_link_libraries(aswm libaswm)
2025-02-01 10:10:56 +00:00
add_compile_definitions(ASWM_TEST_DIR="${CMAKE_CURRENT_SOURCE_DIR}/test/")
add_executable(test_aswm
test/test_set_up.c
test/aswm/test_aswm.c
)
2025-02-01 10:10:56 +00:00
target_include_directories(test_aswm PUBLIC ${unity_SOURCE_DIR}/src)
2025-01-18 09:20:49 +00:00
target_link_libraries(test_aswm libaswm unity)
enable_testing()
add_test(aswm test_aswm)