aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorzjeffer <[email protected]>2024-05-22 00:02:01 +0200
committerMihai Fufezan <[email protected]>2024-05-25 23:03:27 +0300
commita71207434c0bc2c8e05e94b1619e68059a002879 (patch)
treec21b229ab3aea2652334ec025dd883e42ff9caf9 /CMakeLists.txt
parent71c2ff3105942fb5d698225012d2082219e868de (diff)
downloadHyprland-a71207434c0bc2c8e05e94b1619e68059a002879.tar.gz
Hyprland-a71207434c0bc2c8e05e94b1619e68059a002879.zip
Add custom cmake target for installheaders
This will ensure the correct headers are generated before trying to install them.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 858502cc..adc9a5a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -219,6 +219,9 @@ message(STATUS "Setting link libraries")
target_link_libraries(Hyprland rt PkgConfig::deps)
+# used by `make installheaders`, to ensure the headers are generated
+add_custom_target(generate-protocol-headers)
+
function(protocol protoPath protoName external)
if (external)
set(path ${CMAKE_SOURCE_DIR}/${protoPath})
@@ -236,9 +239,10 @@ function(protocol protoPath protoName external)
COMMAND ${WaylandScanner} private-code ${path} protocols/${protoName}-protocol.c
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
- target_sources(Hyprland PRIVATE ${CMAKE_SOURCE_DIR}/protocols/${protoName}-protocol.h)
- target_sources(Hyprland PRIVATE ${CMAKE_SOURCE_DIR}/protocols/${protoName}-protocol.c)
+ target_sources(Hyprland PRIVATE ${CMAKE_SOURCE_DIR}/protocols/${protoName}-protocol.h ${CMAKE_SOURCE_DIR}/protocols/${protoName}-protocol.c)
+ target_sources(generate-protocol-headers PRIVATE ${CMAKE_SOURCE_DIR}/protocols/${protoName}-protocol.h)
endfunction()
+
function(protocolNew protoPath protoName external)
if (external)
set(path ${CMAKE_SOURCE_DIR}/${protoPath})
@@ -251,8 +255,8 @@ function(protocolNew protoPath protoName external)
COMMAND hyprwayland-scanner ${path}/${protoName}.xml ${CMAKE_SOURCE_DIR}/protocols/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
- target_sources(Hyprland PRIVATE protocols/${protoName}.cpp)
- target_sources(Hyprland PRIVATE protocols/${protoName}.hpp)
+ target_sources(Hyprland PRIVATE protocols/${protoName}.cpp protocols/${protoName}.hpp)
+ target_sources(generate-protocol-headers PRIVATE ${CMAKE_SOURCE_DIR}/protocols/${protoName}.hpp)
endfunction()
function(protocolWayland)
add_custom_command(
@@ -261,8 +265,8 @@ function(protocolWayland)
COMMAND hyprwayland-scanner --wayland-enums ${WAYLAND_SERVER_DIR}/wayland.xml ${CMAKE_SOURCE_DIR}/protocols/
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
- target_sources(Hyprland PRIVATE protocols/wayland.cpp)
- target_sources(Hyprland PRIVATE protocols/wayland.hpp)
+ target_sources(Hyprland PRIVATE protocols/wayland.cpp protocols/wayland.hpp)
+ target_sources(generate-protocol-headers PRIVATE ${CMAKE_SOURCE_DIR}/protocols/wayland.hpp)
endfunction()
target_link_libraries(Hyprland