48 lines
1.2 KiB
CMake
48 lines
1.2 KiB
CMake
cmake_minimum_required(VERSION 3.21)
|
|
|
|
project(aswm)
|
|
|
|
set(CMAKE_C_STANDARD 23)
|
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fsanitize=address -pg")
|
|
|
|
include(FetchContent)
|
|
|
|
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(zlog argparse)
|
|
|
|
add_library(libaswm
|
|
src/aswm/aswm.c
|
|
src/aswm/mapper/mapper.c
|
|
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
|
|
src/aswm/event_handlers/unmap.c
|
|
src/aswm/event_handlers/property.c
|
|
src/aswm/event_handlers/message.c
|
|
src/aswm/log/log.c
|
|
)
|
|
target_include_directories(libaswm PUBLIC ${X11_INCLUDE_DIR} src
|
|
${zlog_SOURCE_DIR}/src)
|
|
target_link_libraries(libaswm ${X11_LIBRARIES} zlog)
|
|
|
|
add_executable(aswm src/aswm/main.c ${argparse_SOURCE_DIR}/argparse.c)
|
|
target_include_directories(aswm PUBLIC ${argparse_SOURCE_DIR})
|
|
target_link_libraries(aswm libaswm)
|
|
|
|
add_subdirectory(test)
|