File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -14,17 +14,18 @@ function(embed_headers output)
14
14
foreach (header ${HEADERS} )
15
15
set_property (DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${header} )
16
16
17
- file (REAL_PATH ${header} file_real_path)
18
- set (include_path ${CMAKE_CURRENT_SOURCE_DIR} /../include )
17
+ file (REAL_PATH ${header} header_path)
18
+ file (REAL_PATH ${CMAKE_SOURCE_DIR} /include include_path )
19
+ file (REAL_PATH ${CMAKE_SOURCE_DIR} base_path)
19
20
20
- cmake_path(IS_PREFIX include_path ${file_real_path } NORMALIZE in_include)
21
+ cmake_path(IS_PREFIX include_path ${header_path } NORMALIZE in_include)
21
22
if (${in_include} )
22
- file (RELATIVE_PATH file_rel_path ${include_path} ${file_real_path } )
23
+ file (RELATIVE_PATH header_rel_path ${include_path} ${header_path } )
23
24
else ()
24
- file (RELATIVE_PATH file_rel_path ${CMAKE_CURRENT_SOURCE_DIR} /.. ${file_real_path } )
25
+ file (RELATIVE_PATH header_rel_path ${base_path} ${header_path } )
25
26
endif ()
26
27
27
- string (MAKE_C_IDENTIFIER ${file_rel_path } varname)
28
+ string (MAKE_C_IDENTIFIER ${header_rel_path } varname)
28
29
get_filename_component (filename ${header} NAME )
29
30
30
31
file (READ ${header} contents)
You can’t perform that action at this time.
0 commit comments