1function(pico_message param)
2    if (${ARGC} EQUAL 1)
3        message("${param}")
4        return()
5    endif ()
6
7    if (NOT ${ARGC} EQUAL 2)
8        message(FATAL_ERROR "Expect at most 2 arguments")
9    endif ()
10    message("${param}" "${ARGV1}")
11endfunction()
12
13macro(assert VAR MSG)
14    if (NOT ${VAR})
15        message(FATAL_ERROR "${MSG}")
16    endif ()
17endmacro()
18
19function(pico_find_in_paths OUT PATHS NAME)
20    foreach(PATH IN LISTS ${PATHS})
21        if (EXISTS ${PATH}/${NAME})
22            get_filename_component(FULLNAME ${PATH}/${NAME} ABSOLUTE)
23            set(${OUT} ${FULLNAME} PARENT_SCOPE)
24            return()
25        endif()
26    endforeach()
27    set(${OUT} "" PARENT_SCOPE)
28endfunction()