SDK CMake API Reference
This page was auto-generated from cmake source files using generate_cmake_rst.py
Public CMake functions / macros
add_subdirectory_ifdef()
sdk_app_inc()
sdk_app_src()
sdk_app_src_glob()
sdk_clear_compile_options()
sdk_compile_definitions()
sdk_compile_definitions_ifdef()
sdk_compile_options()
sdk_gcc_inc()
sdk_gcc_src()
sdk_gcc_src_glob()
sdk_get_compile_options()
sdk_iar_asm_preinclude()
sdk_iar_cc_preinclude()
sdk_iar_compile_definitions()
sdk_iar_compile_options()
sdk_iar_enable_andesperf()
sdk_iar_enable_dsp()
sdk_iar_enable_no_size_constraints()
sdk_iar_inc()
sdk_iar_link_libraries()
sdk_iar_src()
sdk_iar_src_glob()
sdk_inc()
sdk_inc_ifdef()
sdk_inc_ifndef()
sdk_ld_options()
sdk_ld_options_ifdef()
sdk_link_libraries()
sdk_link_libraries_ifdef()
sdk_linker_global_symbols()
sdk_nds_compile_definitions()
sdk_nds_compile_options()
sdk_nds_ld_options()
sdk_nds_link_libraries()
sdk_raise_fatal_error_if_all_invalid()
sdk_raise_fatal_error_if_all_valid()
sdk_raise_fatal_error_if_valid_at_least_one()
sdk_ses_compile_definitions()
sdk_ses_compile_options()
sdk_ses_inc()
sdk_ses_link_libraries()
sdk_ses_options()
sdk_ses_src()
sdk_ses_src_glob()
sdk_src()
sdk_src_glob()
sdk_src_glob_ifdef()
sdk_src_glob_ifndef()
sdk_src_ifdef()
sdk_src_ifndef()
sdk_sys_inc()
sdk_zcc_compile_definitions()
sdk_zcc_compile_options()
sdk_zcc_ld_options()
sdk_zcc_link_libraries()
add_subdirectory_ifdef
- add_subdirectory_ifdef(feature)
[function defined in cmake-ext.cmake]
Add subdirectory if feature is true
- Example:
add_subdirectory_ifdef(FEATUREA paths)
- Param FEATUREA:
if FEATUREA is defined, paths will be added
- Param paths:
directories to be added
sdk_app_inc
- sdk_app_inc()
[function defined in cmake-ext.cmake]
Add application specific include path
- Example:
sdk_app_inc(INC_PATH)
- Param INC_PATH:
add include path for application
sdk_app_src
- sdk_app_src()
[function defined in cmake-ext.cmake]
Add application source
- Example:
sdk_app_src(SOURCE_FILE)
- Param SOURCE_FILE:
source files to be added to application
sdk_app_src_glob
sdk_clear_compile_options
- sdk_clear_compile_options()
[function defined in cmake-ext.cmake]
Clear all compile options
sdk_compile_definitions
- sdk_compile_definitions()
[function defined in cmake-ext.cmake]
Set compile definitions
- Example:
sdk_compile_definitions(def)
- Param def:
compiler preprocesing definition
sdk_compile_definitions_ifdef
- sdk_compile_definitions_ifdef(feature)
[function defined in cmake-ext.cmake]
set compile definitions if feature is true
- Example:
sdk_compile_definitions(def)
- Param def:
compiler preprocesing definition
sdk_compile_options
- sdk_compile_options()
[function defined in cmake-ext.cmake]
Set compile options
- Example:
sdk_compile_options(opts)
- Param opts:
compile options
sdk_gcc_inc
- sdk_gcc_inc()
[function defined in cmake-ext.cmake]
Add include path for gcc
- Example:
sdk_gcc_inc(INC_PATH)
- Param INC_PATH:
add include path
sdk_gcc_src
- sdk_gcc_src()
[function defined in cmake-ext.cmake]
Add source specifically for gcc
- Example:
sdk_gcc_src(SOURCE_FILE)
- Param SOURCE_FILE:
source files to be added to HPM_SDK_LIB
sdk_gcc_src_glob
sdk_get_compile_options
- sdk_get_compile_options(opts)
[function defined in cmake-ext.cmake]
Return all compiler options, separated by single space
- Example:
sdk_get_copmile_options(opts)
- Param opts:
all compile options configured for current project
sdk_iar_asm_preinclude
- sdk_iar_asm_preinclude(file)
[function defined in ide/iar.cmake]
Set asm preinclude for IAR
sdk_iar_cc_preinclude
- sdk_iar_cc_preinclude(file)
[function defined in ide/iar.cmake]
Set cc preinclude for IAR
sdk_iar_compile_definitions
- sdk_iar_compile_definitions()
[function defined in ide/iar.cmake]
Set compile definitions for IAR
- Example:
sdk_iar_compile_definitions(def)
- Param def:
compiler preprocesing definition
sdk_iar_compile_options
- sdk_iar_compile_options()
[function defined in ide/iar.cmake]
Set compile options for IAR
- Example:
sdk_iar_compile_options(opts)
- Param opts:
compile options
sdk_iar_enable_andesperf
- sdk_iar_enable_andesperf()
[function defined in ide/iar.cmake]
Enable iar andes performance ext
sdk_iar_enable_dsp
- sdk_iar_enable_dsp()
[function defined in ide/iar.cmake]
Enable DSP in IAR
sdk_iar_enable_no_size_constraints
- sdk_iar_enable_no_size_constraints()
[function defined in ide/iar.cmake]
Enable no size constraints
sdk_iar_inc
- sdk_iar_inc()
[function defined in ide/iar.cmake]
Add include path for IAR
- Example:
sdk_iar_link_libraries(libs)
- Param libs:
libraries to be linked for IAR
sdk_iar_link_libraries
- sdk_iar_link_libraries()
[function defined in ide/iar.cmake]
link libraries for IAR
- Example:
sdk_iar_link_libraries(libs)
- Param libs:
standard libraries to be linked for IAR
sdk_iar_src
- sdk_iar_src()
[function defined in ide/iar.cmake]
Add source file for IAR
- Example:
sdk_iar_src(SOURCE_FILE)
- Param SOURCE_FILE:
source file added for IAR
sdk_iar_src_glob
sdk_inc
- sdk_inc()
[function defined in cmake-ext.cmake]
Add include path
- Example:
sdk_inc(INC_PATH)
- Param INC_PATH:
add include path
sdk_inc_ifdef
- sdk_inc_ifdef(feature)
[function defined in cmake-ext.cmake]
Add include path if feature is true
sdk_inc_ifndef
- sdk_inc_ifndef(feature)
[function defined in cmake-ext.cmake]
Add include path if feature is false
sdk_ld_options
- sdk_ld_options()
[function defined in cmake-ext.cmake]
Set linker options
- Example:
sdk_ld_options(opts)
- Param opts:
linker options
sdk_ld_options_ifdef
- sdk_ld_options_ifdef(feature)
[function defined in cmake-ext.cmake]
Set linker options if feature is true
- Example:
sdk_ld_options_ifdef(FEATUREA opts)
- Param FEATUREA:
if FEATUREA is true, opts will be added for linker
- Param opts:
linker options
sdk_link_libraries
- sdk_link_libraries()
[function defined in cmake-ext.cmake]
Link libraries
- Example:
sdk_link_libraries(libs)
- Param libs:
libraries to be linked, support both file path (like USER_LIB.a) and standard libraries provided by toolchain (like m)
sdk_link_libraries_ifdef
- sdk_link_libraries_ifdef(feature)
[function defined in cmake-ext.cmake]
link libraries if feature is true
- Example:
sdk_ld_options(opts)
- Param opts:
linker options
sdk_linker_global_symbols
- sdk_linker_global_symbols()
[function defined in cmake-ext.cmake]
Define global symbols for linker
- Example:
sdk_linker_global_symbols(syms)
- Param syms:
symboles for linker
sdk_nds_compile_definitions
- sdk_nds_compile_definitions()
[function defined in cmake-ext.cmake]
Set defnitions for nds toolchain
- Example:
sdk_nds_compie_definitions(defs)
- Param defs:
definitions for andes toolchain
sdk_nds_compile_options
- sdk_nds_compile_options()
[function defined in cmake-ext.cmake]
Set compile options for nds toolchain
- Example:
sdk_nds_compile_options(opts)
- Param opts:
options for nds toolchain
sdk_nds_ld_options
- sdk_nds_ld_options()
[function defined in cmake-ext.cmake]
Set linker options
- Example:
sdk_nds_ld_options(opts)
- Param opts:
linker options
sdk_nds_link_libraries
- sdk_nds_link_libraries()
[function defined in cmake-ext.cmake]
Link libraries for andes toolchains
- Example:
sdk_nds_link_libraries(libs)
- Param libs:
libraries to be linked, support both file path (like USER_LIB.a) and standard libraries provided by toolchain (like m)
sdk_raise_fatal_error_if_all_invalid
- sdk_raise_fatal_error_if_all_invalid()
[function defined in cmake-ext.cmake]
Raise fatal error if symbols given are all not set or set to 0 or n
- Example:
sdk_raise_fatal_error_if_all_invalid(FEATUREA FEATUREB)
- Param FEATUREA FEAUTREB:
features to be checked
sdk_raise_fatal_error_if_all_valid
- sdk_raise_fatal_error_if_all_valid()
[function defined in cmake-ext.cmake]
Raise fatal error if symbols given are all set or set to 1 or y
- Example:
sdk_raise_fatal_error_if_all_valid(FEATUREA FEATUREB)
- Param FEATUREA FEAUTREB:
features to be checked
sdk_raise_fatal_error_if_valid_at_least_one
- sdk_raise_fatal_error_if_valid_at_least_one()
[function defined in cmake-ext.cmake]
Raise fatal error if at least one of them given symbols is set or set to 1 or y
- Example:
sdk_raise_fatal_error_if_valid_at_least_one(FEATUREA FEATUREB)
- Param FEATUREA FEAUTREB:
features to be checked
sdk_ses_compile_definitions
- sdk_ses_compile_definitions()
[function defined in ide/segger.cmake]
Set compile definitions for SES
- Example:
sdk_ses_compile_definitions(def)
- Param def:
compiler preprocesing definition
sdk_ses_compile_options
- sdk_ses_compile_options()
[function defined in ide/segger.cmake]
Set compile options for SES
- Example:
sdk_ses_compile_options(opts)
- Param opts:
compile options
sdk_ses_inc
- sdk_ses_inc()
[function defined in ide/segger.cmake]
Add include path for SES
- Example:
sdk_ses_link_libraries(libs)
- Param libs:
libraries to be linked for SES
sdk_ses_link_libraries
- sdk_ses_link_libraries()
[function defined in ide/segger.cmake]
link libraries for SES
- Example:
sdk_ses_link_libraries(libs)
- Param libs:
standard libraries to be linked for SES
sdk_ses_options
- sdk_ses_options()
[function defined in ide/segger.cmake]
Add options for SES project
- Example:
sdk_ses_options(option_key_value_list)
- Param option_key_value_list:
list of option key-value pair, split with space like “option_a_name=option_a_value” to add option_a_name with value of option_a_value in the project file
sdk_ses_src
- sdk_ses_src()
[function defined in ide/segger.cmake]
Add source file for SES
- Example:
sdk_ses_src(SOURCE_FILE)
- Param SOURCE_FILE:
source file added for SES
sdk_ses_src_glob
sdk_src
- sdk_src()
[function defined in cmake-ext.cmake]
Add source file to sdk core (HPM_SDK_LIB)
- Example:
sdk_src(SOURCE_FILE)
- Param SOURCE_FILE:
source files to be added to HPM_SDK_LIB
sdk_src_glob
sdk_src_glob_ifdef
- sdk_src_glob_ifdef(feature)
[function defined in cmake-ext.cmake]
Add source file (glob pattern) for gcc if feature is true
sdk_src_glob_ifndef
- sdk_src_glob_ifndef(feature)
[function defined in cmake-ext.cmake]
Add source file (glob pattern) for gcc if feature is false
sdk_src_ifdef
- sdk_src_ifdef(feature)
[function defined in cmake-ext.cmake]
Add source to SDK core if feature is true
sdk_src_ifndef
- sdk_src_ifndef(feature)
[function defined in cmake-ext.cmake]
Add source to SDK core if feature is false
sdk_sys_inc
- sdk_sys_inc()
[function defined in cmake-ext.cmake]
Add system include path
- Example:
sdk_sys_inc(SYS_INC_PATH)
- Param SYS_INC_PATH:
add system include path
sdk_zcc_compile_definitions
- sdk_zcc_compile_definitions()
[function defined in cmake-ext.cmake]
Set defnitions for zcc toolchain
- Example:
sdk_zcc_compile_definitions(defs)
- Param defs:
definitions for zcc toolchain
sdk_zcc_compile_options
- sdk_zcc_compile_options()
[function defined in cmake-ext.cmake]
Set compile options for zcc toolchain
- Example:
sdk_zcc_compile_options(opts)
- Param opts:
options for zcc toolchain
sdk_zcc_ld_options
- sdk_zcc_ld_options()
[function defined in cmake-ext.cmake]
Set linker options
- Example:
sdk_zcc_ld_options(opts)
- Param opts:
linker options
sdk_zcc_link_libraries
- sdk_zcc_link_libraries()
[function defined in cmake-ext.cmake]
Link libraries for zcc toolchains
- Example:
sdk_zcc_link_libraries(libs)
- Param libs:
libraries to be linked, support both file path (like USER_LIB.a) and standard libraries provided by toolchain (like m)