我正在尝试创建一个链接到一组“OBJECT”库/目标的CMake宏。但我无法设法让它发挥作用。生成Visual Studion项目但没有引用.lib
文件!
有人有想法吗?
当我显示“targets_list”的内容时,我有:
$<TARGET_OBJECTS:base>;$<TARGET_OBJECTS:graphics>;$<TARGET_OBJECTS:geodesy>;$<TARGET_OBJECTS:map>
以下是代码:
macro(AddSubProject project_name project_folder)
...
# Links
list(APPEND targets_list "")
foreach (module ${ARGV2})
list(APPEND targets_list $<TARGET_OBJECTS:${module}>)
endforeach ()
add_library(${project_name} SHARED ${_source_list} ${targets_list})
endmacro()