1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:17:35 +00:00

CMake: Modify include path when building from Hack Studio

With regular builds, the generated IPC headers exist inside the Build
directory. The path Userland/Services under the build directory is
added to the include path.

For in-system builds the IPC headers are installed at /usr/include/.
To support this, we add /usr/include/Userland/Services to the build path
when building from Hack Studio.

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
This commit is contained in:
Itamar 2022-03-19 17:15:08 +02:00 committed by Andreas Kling
parent fe7d28e870
commit b6f358689c
3 changed files with 5 additions and 0 deletions

View file

@ -33,6 +33,8 @@ function(compile_ipc source output)
add_custom_target(generate_${output_name} DEPENDS ${output})
add_dependencies(all_generated generate_${output_name})
# TODO: Use cmake_path() when we upgrade the minimum CMake version to 3.20
# https://cmake.org/cmake/help/v3.23/command/cmake_path.html#relative-path
string(LENGTH ${SerenityOS_SOURCE_DIR} root_source_dir_length)
string(SUBSTRING ${CMAKE_CURRENT_SOURCE_DIR} ${root_source_dir_length} -1 current_source_dir_relative)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${output} DESTINATION usr/include${current_source_dir_relative} OPTIONAL)