CMake删除添加的库

时间:2018-04-01 15:33:26

标签: cmake

有没有办法从LINK_LIBRARIES添加的target_link_libraries删除库?

target_link_libraries(Project library1 library2)
get_target_property(cur_cflags Project LINK_LIBRARIES)
message(STATUS ${cur_cflags})
# should print library1 and library2
# here I do something to remove library1
get_target_property(cur_cflags Project LINK_LIBRARIES)
message(STATUS ${cur_cflags})
#should print library2 only

由于

1 个答案:

答案 0 :(得分:0)

检查

var arr = ['1.10.3.e', '1.9.5.b', '1.7.3', '1.5.1.c', '1.5.1.a', '1.5.1.d', '1.10', '1.5']
          .map(a => a.split('.') // split by decimals
                     .map(i => Number.isNaN(parseInt(i, 10)) ? i : parseInt(i, 10))) // make numbers numbers, leave chars as strings
          .sort((a,b) => {
              // sort by multiple indexes and if one array is shorter, it's i item will be undefined
              var longerIndex = a.length > b.length ? a.length : b.length;
              for(var i = 0, l = longerIndex; i < l; i++) {
                if (a[i] > b[i] || b[i] === undefined) return 1;
                else if (a[i] < b[i] || a[i] === undefined) return -1;
              }

              return 0;
          })
          .map(a => a.join('.')) // join the version parts back into a single string
console.log(arr);