Skip to content

Commit b574eb7

Browse files
committed
fix resources names with symlinks
1 parent b1e98dd commit b574eb7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

resources/CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ function(embed_headers output)
1414
foreach(header ${HEADERS})
1515
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${header})
1616

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)
1920

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)
2122
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})
2324
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})
2526
endif()
2627

27-
string(MAKE_C_IDENTIFIER ${file_rel_path} varname)
28+
string(MAKE_C_IDENTIFIER ${header_rel_path} varname)
2829
get_filename_component(filename ${header} NAME)
2930

3031
file(READ ${header} contents)

0 commit comments

Comments
 (0)