Skip to content

Instantly share code, notes, and snippets.

@3gx
Forked from antiagainst/function-argument.cmake
Last active November 8, 2018 11:36
Show Gist options
  • Select an option

  • Save 3gx/e015637e2bc87b7b25f5 to your computer and use it in GitHub Desktop.

Select an option

Save 3gx/e015637e2bc87b7b25f5 to your computer and use it in GitHub Desktop.

Revisions

  1. @antiagainst antiagainst renamed this gist Dec 28, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. @antiagainst antiagainst created this gist Dec 28, 2014.
    21 changes: 21 additions & 0 deletions cmake-function-argument
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    cmake_minimum_required(VERSION 2.8)

    function(use_llvm TARGET)
    message("ARGC=\"${ARGC}\"")
    message("ARGN=\"${ARGN}\"")
    message("ARGV=\"${ARGV}\"")
    message("ARGV0=\"${ARGV0}\"")
    message("ARGV1=\"${ARGV1}\"")
    endfunction()

    add_custom_target(foo
    COMMAND ls)

    use_llvm(foo core bitwriter)

    # Results:
    # ARGC="3"
    # ARGN="core;bitwriter"
    # ARGV="foo;core;bitwriter"
    # ARGV0="foo"
    # ARGV1="core"