File tree Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,18 @@ if(ACL_TSAN)
220
220
endforeach ()
221
221
endif ()
222
222
223
+ function (define_file_basename_for_sources targetname )
224
+ get_target_property (source_files "${targetname} " SOURCES )
225
+ foreach (sourcefile ${source_files} )
226
+ # Add the FILE_BASENAME=filename compile definition to the list.
227
+ get_filename_component (basename "${sourcefile} " NAME )
228
+ # Set the updated compile definitions on the source file.
229
+ set_property (
230
+ SOURCE "${sourcefile} " APPEND
231
+ PROPERTY COMPILE_DEFINITIONS "__FILE__=\" ${basename} \" " )
232
+ endforeach ()
233
+ endfunction ()
234
+
223
235
include (CPack )
224
236
include (CTest )
225
237
Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ set_property(TARGET acl_hash PROPERTY PUBLIC_HEADER
8
8
include /acl_hash/acl_hash.h
9
9
)
10
10
11
+
12
+ define_file_basename_for_sources (acl_hash )
13
+
11
14
install (TARGETS acl_hash
12
15
COMPONENT acl_hash
13
16
EXCLUDE_FROM_ALL
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ set_property(TARGET acl_threadsupport PROPERTY PUBLIC_HEADER
8
8
include /acl_threadsupport/acl_threadsupport.h
9
9
)
10
10
11
+ define_file_basename_for_sources (acl_threadsupport )
12
+
11
13
install (TARGETS acl_threadsupport
12
14
COMPONENT acl_threadsupport
13
15
EXCLUDE_FROM_ALL
Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ if(ZLIB_FOUND)
22
22
target_link_libraries (pkg_editor PRIVATE ZLIB::ZLIB )
23
23
endif ()
24
24
25
+ define_file_basename_for_sources (pkg_editor )
26
+
25
27
install (TARGETS pkg_editor
26
28
COMPONENT pkg_editor
27
29
EXCLUDE_FROM_ALL
You can’t perform that action at this time.
0 commit comments