swm/CMakeLists.txt

31 lines
1.2 KiB
CMake
Raw Normal View History

# Set minimum CMake version, this number may change depending on features used! (We should really change this to the absolute minimum to get this file to build)
2021-12-08 00:55:01 +00:00
cmake_minimum_required (VERSION 3.6)
project(swm_project DESCRIPTION "swm (swim) is a simple dynamic window manager.")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake")
# We need the XCB version of Xinerama, set this to off as this feature isn't truly implemented
option(XINERAMA "Allow multimonitor support via the common x extension xinerama." OFF)
2021-12-08 00:55:01 +00:00
add_executable(swm src/main.cpp)
2021-12-08 02:03:05 +00:00
find_package(xcb REQUIRED)
2021-12-08 00:55:01 +00:00
find_package(toml11 REQUIRED)
# Link headers and source files.
file(GLOB_RECURSE source_list src/*.cpp)
target_sources(swm PRIVATE ${source_list})
target_include_directories(swm PUBLIC include)
# Link depends
target_link_libraries(swm PUBLIC ${XCB_LIBRARIES})
target_link_libraries(swm PUBLIC toml11::toml11)
# TODO: Link the XCB-Xinerama library to our project, but since we aren't using it I'm leaving it out for now.
if (XINERAMA)
# define this so we can use ifdef for this feature.
add_compile_definitions(XINERAMA)
endif()
2021-12-08 00:55:01 +00:00
# Set standard to C++20
set_target_properties(swm PROPERTIES CXX_STANDARD 20 CXX_EXTENSIONS OFF)