Use ARGN where applicable
This commit is contained in:
parent
a20e3a1349
commit
1c07a71d6f
7 changed files with 12 additions and 34 deletions
|
|
@ -13,10 +13,8 @@ function(init_target_folder target_name folder_name)
|
|||
endfunction()
|
||||
|
||||
function(init_target target_name) # init_target(my_target [cxx_std_..] folder_name)
|
||||
set(argslist ${ARGV})
|
||||
list(REMOVE_AT argslist 0)
|
||||
set(standard ${MAXIMUM_CXX_STANDARD})
|
||||
foreach (entry ${argslist})
|
||||
foreach (entry ${ARGN})
|
||||
if (${entry} STREQUAL cxx_std_14 OR ${entry} STREQUAL cxx_std_11 OR ${entry} STREQUAL cxx_std_17)
|
||||
set(standard ${entry})
|
||||
else()
|
||||
|
|
|
|||
|
|
@ -5,9 +5,6 @@
|
|||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
function(nice_target_sources target_name src_loc)
|
||||
set(list ${ARGV})
|
||||
list(REMOVE_AT list 0 1)
|
||||
|
||||
set(writing_now "")
|
||||
set(private_sources "")
|
||||
set(public_sources "")
|
||||
|
|
@ -15,7 +12,7 @@ function(nice_target_sources target_name src_loc)
|
|||
set(not_win_sources "")
|
||||
set(not_mac_sources "")
|
||||
set(not_linux_sources "")
|
||||
foreach (entry ${list})
|
||||
foreach (entry ${ARGN})
|
||||
if (${entry} STREQUAL "PRIVATE" OR ${entry} STREQUAL "PUBLIC" OR ${entry} STREQUAL "INTERFACE")
|
||||
set(writing_now ${entry})
|
||||
else()
|
||||
|
|
@ -71,11 +68,8 @@ function(nice_target_sources target_name src_loc)
|
|||
endfunction()
|
||||
|
||||
function(remove_target_sources target_name src_loc)
|
||||
set(list ${ARGV})
|
||||
list(REMOVE_AT list 0 1)
|
||||
|
||||
set(sources "")
|
||||
foreach (entry ${list})
|
||||
foreach (entry ${ARGN})
|
||||
set(full_name ${src_loc}/${entry})
|
||||
list(APPEND sources ${full_name})
|
||||
endforeach()
|
||||
|
|
|
|||
|
|
@ -7,14 +7,11 @@
|
|||
include(CheckCXXCompilerFlag)
|
||||
|
||||
function(target_compile_options_if_exists target_name)
|
||||
set(list ${ARGV})
|
||||
list(REMOVE_AT list 0)
|
||||
|
||||
set(writing_now "")
|
||||
set(private_options "")
|
||||
set(public_options "")
|
||||
set(interface_options "")
|
||||
foreach (entry ${list})
|
||||
foreach (entry ${ARGN})
|
||||
if (${entry} STREQUAL "PRIVATE" OR ${entry} STREQUAL "PUBLIC" OR ${entry} STREQUAL "INTERFACE")
|
||||
set(writing_now ${entry})
|
||||
else()
|
||||
|
|
|
|||
|
|
@ -5,15 +5,11 @@
|
|||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
function(target_link_frameworks_generic type target_name)
|
||||
set(list ${ARGV})
|
||||
list(REMOVE_AT list 1)
|
||||
list(REMOVE_AT list 0)
|
||||
|
||||
set(writing_now "")
|
||||
set(private_frameworks "")
|
||||
set(public_frameworks "")
|
||||
set(interface_frameworks "")
|
||||
foreach (entry ${list})
|
||||
foreach (entry ${ARGN})
|
||||
if (${entry} STREQUAL "PRIVATE" OR ${entry} STREQUAL "PUBLIC" OR ${entry} STREQUAL "INTERFACE")
|
||||
set(writing_now ${entry})
|
||||
else()
|
||||
|
|
@ -41,10 +37,10 @@ function(target_link_frameworks_generic type target_name)
|
|||
endif()
|
||||
endfunction()
|
||||
|
||||
function(target_link_frameworks target_name)
|
||||
target_link_frameworks_generic("-framework" ${ARGV})
|
||||
function(target_link_frameworks)
|
||||
target_link_frameworks_generic("-framework" ${ARGN})
|
||||
endfunction()
|
||||
|
||||
function(target_link_frameworks_weak target_name)
|
||||
target_link_frameworks_generic("-weak_framework" ${ARGV})
|
||||
function(target_link_frameworks_weak)
|
||||
target_link_frameworks_generic("-weak_framework" ${ARGN})
|
||||
endfunction()
|
||||
|
|
|
|||
|
|
@ -7,14 +7,11 @@
|
|||
include(CheckCXXCompilerFlag)
|
||||
|
||||
function(target_link_options_if_exists target_name)
|
||||
set(list ${ARGV})
|
||||
list(REMOVE_AT list 0)
|
||||
|
||||
set(writing_now "")
|
||||
set(private_options "")
|
||||
set(public_options "")
|
||||
set(interface_options "")
|
||||
foreach (entry ${list})
|
||||
foreach (entry ${ARGN})
|
||||
if (${entry} STREQUAL "PRIVATE" OR ${entry} STREQUAL "PUBLIC" OR ${entry} STREQUAL "INTERFACE")
|
||||
set(writing_now ${entry})
|
||||
else()
|
||||
|
|
|
|||
|
|
@ -5,14 +5,11 @@
|
|||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
function(target_link_static_libraries target_name)
|
||||
set(list ${ARGV})
|
||||
list(REMOVE_AT list 0)
|
||||
|
||||
set(writing_now "")
|
||||
set(private_libs "")
|
||||
set(public_libs "")
|
||||
set(interface_libs "")
|
||||
foreach (entry ${list})
|
||||
foreach (entry ${ARGN})
|
||||
if (${entry} STREQUAL "PRIVATE" OR ${entry} STREQUAL "PUBLIC" OR ${entry} STREQUAL "INTERFACE")
|
||||
set(writing_now ${entry})
|
||||
else()
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@
|
|||
# https://github.com/desktop-app/legal/blob/master/LEGAL
|
||||
|
||||
function(target_add_resource target_name)
|
||||
set(list ${ARGV})
|
||||
list(REMOVE_AT list 0)
|
||||
set(list ${ARGN})
|
||||
target_sources(${target_name} PRIVATE ${list})
|
||||
get_target_property(existing_resources ${target_name} RESOURCE)
|
||||
if (NOT "${existing_resources}" STREQUAL "existing_resources-NOTFOUND")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue