1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 04:07:46 +00:00

CMake: Make sure to install generated sources and header files

We weren't installing a lot of generated sources for the top level Lagom
build or for LibWeb, making it impossible to use LibWeb from a
find_package. ...And also Kernel/API/KeyCode.h, which is included by
no less than 8 different files in Userland/Libraries. We also weren't
installing any Ladybird header files.
This commit is contained in:
Andrew Kaster 2023-08-07 22:14:22 -06:00 committed by Andrew Kaster
parent 79108f615d
commit 92214b59ab
4 changed files with 62 additions and 9 deletions

View file

@ -377,6 +377,11 @@ install(
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.h"
)
install(FILES
${Lagom_BINARY_DIR}/AK/Debug.h
COMPONENT Lagom_Development
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/AK"
)
# Code Generators and other host tools
if (BUILD_LAGOM_TOOLS)
@ -452,11 +457,14 @@ if (BUILD_LAGOM)
list(APPEND LIBWEBVIEW_GENERATED_SOURCES WebSocket/WebSocketClientEndpoint.h)
list(APPEND LIBWEBVIEW_GENERATED_SOURCES WebSocket/WebSocketServerEndpoint.h)
set(GENERATED_SOURCES ${LIBWEBVIEW_GENERATED_SOURCES})
lagom_lib(LibWebView webview
SOURCES ${LIBWEBVIEW_SOURCES} ${LIBWEBVIEW_GENERATED_SOURCES}
LIBS LibGfx LibGUI LibIPC LibWeb LibProtocol)
unset(GENERATED_SOURCES)
foreach(header ${LIBWEBVIEW_GENERATED_SOURCES})
get_filename_component(subdirectory ${header} DIRECTORY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${header}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${subdirectory}")
endforeach()
install(FILES "${SERENITY_PROJECT_ROOT}/Userland/Services/RequestServer/ConnectionCache.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/RequestServer")
endif()
if (NOT EMSCRIPTEN)
@ -488,6 +496,9 @@ if (BUILD_LAGOM)
SOURCES ${LIBGUI_SOURCES}
LIBS LibGfx LibSyntax)
# FIXME: How about we don't include Kernel/API from random high-level libraries?
install(FILES ${SERENITY_PROJECT_ROOT}/Kernel/API/KeyCode.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/Kernel/API")
# FIXME: LibLocaleData is an object lib in Lagom, because the weak symbol trick we use on serenity
# straight up isn't supposed to work per ELF rules
target_link_libraries(LibLocale PRIVATE LibTimeZone)