@@ -98,25 +98,32 @@ set(sycl_inc_dir ${CMAKE_CURRENT_SOURCE_DIR}/include)
98
98
set (sycl_src_dir ${CMAKE_CURRENT_SOURCE_DIR} /source )
99
99
set (sycl_plugin_dir ${CMAKE_CURRENT_SOURCE_DIR} /plugins )
100
100
string (TIMESTAMP __SYCL_COMPILER_VERSION "%Y%m%d" )
101
+ set (version_header "${sycl_inc_dir} /CL/sycl/version.hpp" )
102
+ configure_file ("${version_header} .in" "${version_header} " )
103
+
104
+ # This is workaround to detect changes (add or modify) in subtree which
105
+ # are not detected by copy_directory command.
106
+ # TODO: detect and process remove header/directory case
107
+ file (GLOB_RECURSE HEADERS_IN_SYCL_DIR CONFIGURE_DEPENDS "${sycl_inc_dir} /sycl/*" )
108
+ file (GLOB_RECURSE HEADERS_IN_CL_DIR CONFIGURE_DEPENDS "${sycl_inc_dir} /CL/*" )
101
109
102
110
# Copy SYCL headers from sources to build directory
103
111
add_custom_target (sycl-headers
104
112
DEPENDS ${SYCL_INCLUDE_BUILD_DIR} /sycl
113
+ ${SYCL_INCLUDE_BUILD_DIR} /sycl/sycl.hpp
105
114
${SYCL_INCLUDE_BUILD_DIR} /sycl/CL )
106
115
107
116
add_custom_command (
108
117
OUTPUT ${SYCL_INCLUDE_BUILD_DIR} /sycl
118
+ ${SYCL_INCLUDE_BUILD_DIR} /sycl/sycl.hpp
109
119
${SYCL_INCLUDE_BUILD_DIR} /sycl/CL
110
- DEPENDS ${sycl_inc_dir} /sycl
111
- ${sycl_inc_dir} /CL
120
+ DEPENDS ${HEADERS_IN_SYCL_DIR}
121
+ ${HEADERS_IN_CL_DIR}
112
122
COMMAND ${CMAKE_COMMAND} -E copy_directory ${sycl_inc_dir} /sycl ${SYCL_INCLUDE_BUILD_DIR} /sycl
113
123
COMMAND ${CMAKE_COMMAND} -E copy_directory ${sycl_inc_dir} /CL ${SYCL_INCLUDE_BUILD_DIR} /sycl/CL
114
124
COMMENT "Copying SYCL headers ..." )
115
125
116
- configure_file ("${sycl_inc_dir} /CL/sycl/version.hpp.in" "${SYCL_INCLUDE_BUILD_DIR} /CL/sycl/version.hpp" )
117
-
118
-
119
- # Copy SYCL headers from sources to install directory
126
+ # Copy SYCL headers from source to install directory
120
127
install (DIRECTORY "${sycl_inc_dir} /sycl" DESTINATION ${SYCL_INCLUDE_DIR} COMPONENT sycl-headers )
121
128
install (DIRECTORY "${sycl_inc_dir} /CL" DESTINATION ${SYCL_INCLUDE_DIR} /sycl COMPONENT sycl-headers )
122
129
0 commit comments