2021-11-18 18:04:09 +01:00
|
|
|
cmake_minimum_required(VERSION 3.4)
|
2022-03-22 16:17:18 +01:00
|
|
|
|
|
|
|
set(CMAKE_CXX_COMPILER "/bin/g++")
|
|
|
|
|
2021-11-18 18:04:09 +01:00
|
|
|
project(Hypr
|
|
|
|
VERSION 0.1
|
|
|
|
DESCRIPTION "A Modern OOP C++ Window Manager"
|
|
|
|
)
|
|
|
|
|
2021-12-18 15:01:20 +01:00
|
|
|
set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
|
|
|
|
|
2021-12-23 10:21:49 +01:00
|
|
|
message(STATUS "Configuring Hypr!")
|
2021-12-18 15:01:20 +01:00
|
|
|
|
2021-11-18 18:04:09 +01:00
|
|
|
add_compile_options(-std=c++17)
|
2021-11-22 18:43:55 +01:00
|
|
|
add_compile_options(-Wall -Wextra)
|
2021-11-21 11:25:26 +01:00
|
|
|
find_package(Threads REQUIRED)
|
2021-11-18 18:04:09 +01:00
|
|
|
|
2021-11-26 20:20:11 +01:00
|
|
|
find_package(PkgConfig REQUIRED)
|
2021-11-26 21:54:52 +01:00
|
|
|
pkg_check_modules(deps REQUIRED IMPORTED_TARGET glib-2.0 harfbuzz cairo gtkmm-3.0 xcb-randr xcb-ewmh xcb-xinerama xcb-cursor xcb-keysyms xcb-icccm)
|
2021-11-26 20:20:11 +01:00
|
|
|
|
2021-11-18 18:04:09 +01:00
|
|
|
file(GLOB_RECURSE SRCFILES "src/*.cpp")
|
|
|
|
|
|
|
|
add_executable(Hypr ${SRCFILES})
|
|
|
|
|
2021-12-18 15:01:20 +01:00
|
|
|
IF(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
|
2021-12-23 10:21:49 +01:00
|
|
|
message(STATUS "Configuring Hypr in Debug with CMake!")
|
2021-12-18 15:01:20 +01:00
|
|
|
ELSE()
|
|
|
|
add_compile_options(-Ofast)
|
2021-12-23 10:21:49 +01:00
|
|
|
message(STATUS "Configuring Hypr in Release with CMake!")
|
|
|
|
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
|
2021-12-18 15:01:20 +01:00
|
|
|
|
2021-11-21 11:25:26 +01:00
|
|
|
target_link_libraries(Hypr rt)
|
|
|
|
|
2021-11-18 18:04:09 +01:00
|
|
|
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
|
|
|
|
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
|
|
|
|
include(CPack)
|
|
|
|
|
2021-11-26 20:20:11 +01:00
|
|
|
target_link_libraries(Hypr PkgConfig::deps)
|
|
|
|
|
2021-11-18 18:04:09 +01:00
|
|
|
target_link_libraries(Hypr
|
|
|
|
xcb
|
|
|
|
xcb-ewmh
|
|
|
|
xcb-icccm
|
|
|
|
xcb-keysyms
|
|
|
|
xcb-randr
|
|
|
|
xcb-xinerama
|
2021-11-25 17:57:50 +01:00
|
|
|
xcb-cursor
|
2021-11-28 14:03:34 +01:00
|
|
|
xcb-shape
|
2021-11-29 21:51:01 +01:00
|
|
|
xcb-util
|
2021-11-21 11:25:26 +01:00
|
|
|
${CMAKE_THREAD_LIBS_INIT}
|
2021-12-18 15:01:20 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
IF(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
|
|
|
|
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -no-pie -fno-builtin")
|
|
|
|
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg -no-pie -fno-builtin")
|
|
|
|
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg -no-pie -fno-builtin")
|
2021-12-23 10:21:49 +01:00
|
|
|
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
|