Browse Source

CMake: Install generated IPC headers under /usr/include in compile_ipc()

Generated IPC headers are now installed under /usr/include in the
system's filesystem image.
Itamar 3 years ago
parent
commit
fe7d28e870
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Meta/CMake/code_generators.cmake

+ 4 - 0
Meta/CMake/code_generators.cmake

@@ -32,6 +32,10 @@ function(compile_ipc source output)
     get_filename_component(output_name ${output} NAME)
     add_custom_target(generate_${output_name} DEPENDS ${output})
     add_dependencies(all_generated generate_${output_name})
+
+    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)
 endfunction()
 
 function(generate_state_machine source header)