![]() ![]() 0 is equivalent to 0, the first list element. If is -1 or lesser, it is indexedįrom the end of the list, with -1 representing the last list element.īe careful when counting with negative indices: they do not start fromĠ. To start a project, we use the project () command to set the project name. This establishes policy settings and ensures that the following CMake functions are run with a compatible version of CMake. Is indexed from the beginning of the list, with 0 representing theįirst list element. Any project's top most CMakeLists.txt must start by specifying a minimum CMake version using the cmakeminimumrequired () command. ![]() When specifying index values, if is 0 or greater, it Variables, and therefore cannot be used in LIST commands.) ![]() For example, set(var a b c d e)Ĭreates a list with a b c d e, and set(var “a b c d e”) creates a NOTES: A list in cmake is a separated group of strings. PARENT_SCOPE, SET with CACHE INTERNAL, or some other means of value Propagate the results of these operations upwards, use SET with The LIST command creates new variable values in the current scope,Įven if the list itself is actually defined in a parent scope. REMOVE_DUPLICATES, REVERSE and SORT may create new values for the list The list subcommands APPEND, INSERT, REMOVE_AT, REMOVE_ITEM, SORT sorts the list in-place alphabetically. REVERSE reverses the contents of the list in-place. REMOVE_DUPLICATES will remove duplicated items in the list. REMOVE_AT will remove the items at the given indices. Theĭifference is that REMOVE_ITEM will remove the given items, while REMOVE_AT and REMOVE_ITEM will remove items from the list. INSERT will insert elements to the list to the specified location. GET will return list of elements specified by indices from the list.įIND will return the index of the element specified in the list or -1 Do not forget to set the CMAKEPREFIXPATH. LENGTH will return a given list’s length. Here, path-to-example-directory is the path to the directory that contains both CMakeLists.txt and example.cpp. List ( LENGTH ) list ( GET ) list ( APPEND ) list ( FIND ) list ( INSERT ) list ( REMOVE_ITEM ) list ( REMOVE_AT ) list ( REMOVE_DUPLICATES ) list ( REVERSE ) list ( SORT ) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |