Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2577992
linklibsys.cmake
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
linklibsys.cmake
View Options
# https://stackoverflow.com/questions/52135983/cmake-target-link-libraries-include-as-system-to-suppress-compiler-warnings
function
(
target_link_libraries_system
target
)
set
(
options
PRIVATE
PUBLIC
INTERFACE
)
cmake_parse_arguments
(
TLLS
"${options}"
""
""
${
ARGN
}
)
foreach
(
op
${
options
}
)
if
(
TLLS_
${
op
}
)
set
(
scope
${
op
}
)
endif
()
endforeach
(
op
)
set
(
libs
${
TLLS_UNPARSED_ARGUMENTS
}
)
foreach
(
lib
${
libs
}
)
get_target_property
(
lib_include_dirs
${
lib
}
INTERFACE_INCLUDE_DIRECTORIES
)
if
(
lib_include_dirs
)
if
(
scope
)
target_include_directories
(
${
target
}
SYSTEM
${
scope
}
${
lib_include_dirs
}
)
else
()
target_include_directories
(
${
target
}
SYSTEM
PRIVATE
${
lib_include_dirs
}
)
endif
()
else
()
message
(
"Warning: ${lib} doesn't set INTERFACE_INCLUDE_DIRECTORIES. No include_directories set."
)
endif
()
if
(
scope
)
target_link_libraries
(
${
target
}
${
scope
}
${
lib
}
)
else
()
target_link_libraries
(
${
target
}
${
lib
}
)
endif
()
endforeach
()
endfunction
(
target_link_libraries_system
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Jun 24, 6:23 PM (1 d, 6 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
92320
Default Alt Text
linklibsys.cmake (1 KB)
Attached To
Mode
rL libkazv
Attached
Detach File
Event Timeline
Log In to Comment