CMake Lists - Jeremi Mucha
jeremimucha.com › 2021 › 03Mar 15, 2021 · set(foobar 1 " 2A" 3 "4B " 5 6C) list(TRANSFORM foobar STRIP) # remove whitespace list(TRANSFORM foobar TOLOWER) # to lower case list(TRANSFORM foobar REPLACE "([0-9])([a-z])" "\\2\\1\\2" REGEX "[0-9][a-z]") This results in the following. foobar: 1;a2a;3;b4b;5;c6c Iteration
remove — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpremove — CMake 3.23.0-rc3 Documentation remove ¶ Deprecated since version 3.0: Use the list (REMOVE_ITEM) command instead. remove (VAR VALUE VALUE ...) Removes VALUE from the variable VAR. This is typically used to remove entries from a vector (e.g. semicolon separated list). VALUE is expanded.
list — CMake 3.23.0-rc4 Documentation
cmake.org › cmake › helplist (REMOVE_DUPLICATES <list>) Removes duplicated items in the list. The relative order of items is preserved, but if duplicates are encountered, only the first instance is preserved. list (TRANSFORM <list> <ACTION> [<SELECTOR>] [OUTPUT_VARIABLE <output variable>]) New in version 3.12.
Cmake命令之list介绍 - 简书
www.jianshu.com › p › 89fb01752d6f# CMakeLists.txt cmake_minimum_required (VERSION 3.12.2) project (list_cmd_test) set (list_test a a b c c d) # 创建列表变量"a;a;b;c;c;d" list (REMOVE_ITEM list_test a) message (">>> REMOVE_ITEM: ${list_test}") list (REMOVE_ITEM list_test b e) message (">>> REMOVE_ITEM: ${list_test}")
list(REMOVE_ITEM) not working in cmake - Stack Overflow
stackoverflow.com › questions › 36134129Mar 21, 2016 · After getting the full path of the special file, I could do a remove from the list. Here is a small example. cmake_minimum_required(VERSION 3.4) project(list_remove_item_ex) file(GLOB SOURCES "src/*.cpp") # this is the file I want to exclude / remove from the list get_filename_component(full_path_test_cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/test.cpp ABSOLUTE) message("${full_path_test_cpp}") list(REMOVE_ITEM SOURCES "${full_path_test_cpp}") message("${SOURCES}")
list — CMake 3.23.0-rc4 Documentation
https://cmake.org/cmake/help/latest/command/list.htmlIntroduction ¶. The list subcommands APPEND, INSERT, FILTER, PREPEND , POP_BACK, POP_FRONT, REMOVE_AT, REMOVE_ITEM , REMOVE_DUPLICATES, REVERSE and SORT may create new values for the list within the current CMake variable scope. Similar to the set () command, the LIST command creates new variable values in the current scope, even if the list ...