Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,12 @@ add_library(xeus-cpp-headers INTERFACE)
set_target_properties(xeus-cpp-headers PROPERTIES PUBLIC_HEADER "${XCPP_HEADERS}")

if (EMSCRIPTEN)
install(TARGETS xeus-cpp-headers PUBLIC_HEADER DESTINATION ${SYSROOT_PATH}/include/xcpp)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${SYSROOT_PATH}/include/xcpp)

message(STATUS "Moving headers to ${SYSROOT_PATH}/include/xcpp")
foreach(header ${XCPP_HEADERS})
file(COPY ${header} DESTINATION ${SYSROOT_PATH}/include/xcpp)
endforeach()
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this to work, we need to preload the required headers (xdisplay.hpp and xmime.hpp to a location where they are accessible)

I expected the install command to do the job here.

I even tried avoiding the complexity of handling INTERFACE targets and potential CMake nuances with PUBLIC_HEADER and just tried

install(FILES ${XCPP_HEADERS} DESTINATION ${SYSROOT_PATH}/include/xcpp)

But even this isn't doing the job.

Hence here I am

  1. Creating the required directory inside ${SYSROOT_PATH}/include that we are already preloading
  2. Explicitly copying the header files there.

And this works !!
I am not sure why the install isn't comfortable around emscripten !?
But untill someone provides a better solution, this should do the required.

else ()
install(TARGETS xeus-cpp-headers PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/xcpp)
endif()
Expand Down