-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
CMakeLists.txt
59 lines (45 loc) · 1.68 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_COMPILER "/bin/g++")
project(Hypr
VERSION 0.1
DESCRIPTION "A Modern OOP C++ Window Manager"
)
set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
message(STATUS "Configuring Hypr!")
add_compile_options(-std=c++17)
add_compile_options(-Wall -Wextra)
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
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)
file(GLOB_RECURSE SRCFILES "src/*.cpp")
add_executable(Hypr ${SRCFILES})
IF(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
message(STATUS "Configuring Hypr in Debug with CMake!")
ELSE()
add_compile_options(-Ofast)
message(STATUS "Configuring Hypr in Release with CMake!")
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)
IF(UNIX AND NOT APPLE)
target_link_libraries(Hypr rt)
ENDIF()
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
target_link_libraries(Hypr PkgConfig::deps)
target_link_libraries(Hypr
xcb
xcb-ewmh
xcb-icccm
xcb-keysyms
xcb-randr
xcb-xinerama
xcb-cursor
xcb-shape
xcb-util
${CMAKE_THREAD_LIBS_INIT}
)
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")
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)