1add_library(pico_binary_info_headers INTERFACE)
2
3target_include_directories(pico_binary_info_headers INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include)
4
5if (COMMAND pico_add_platform_library)
6    pico_add_platform_library(pico_binary_info)
7else()
8    add_library(pico_binary_info INTERFACE)
9endif()
10
11target_link_libraries(pico_binary_info INTERFACE pico_binary_info_headers)
12
13function(pico_set_program_name TARGET name)
14    # PICO_BUILD_DEFINE: PICO_PROGRAM_NAME, value passed to pico_set_program_name, type=string, default=none, group=pico_binary_info
15    target_compile_definitions(${TARGET} PRIVATE -DPICO_PROGRAM_NAME="${name}")
16endfunction()
17
18function(pico_set_program_description TARGET description)
19    # since this is the command line, we will remove newlines
20    string(REPLACE "\n" " " description ${description})
21    string(REPLACE "\"" "\\\"" description ${description})
22    # PICO_BUILD_DEFINE: PICO_PROGRAM_DESCRIPTION, value passed to pico_set_program_description, type=string, default=none, group=pico_binary_info
23    target_compile_definitions(${TARGET} PRIVATE -DPICO_PROGRAM_DESCRIPTION="${description}")
24endfunction()
25
26function(pico_set_program_url TARGET url)
27    # PICO_BUILD_DEFINE: PICO_PROGRAM_URL, value passed to pico_set_program_url, type=string, default=none, group=pico_binary_info
28    target_compile_definitions(${TARGET} PRIVATE -DPICO_PROGRAM_URL="${url}")
29endfunction()
30
31function(pico_set_program_version TARGET version)
32    # PICO_BUILD_DEFINE: PICO_PROGRAM_VERSION_STRING, value passed to pico_set_program_version, type=string, default=none, group=pico_binary_info
33    target_compile_definitions(${TARGET} PRIVATE -DPICO_PROGRAM_VERSION_STRING="${version}")
34endfunction()
35