1 # Add a target to call checkAPIs.pl on the specified source files
2 # The target is excluded from the ALL targte so must be manually
3 # specified in a build command.
4 # The target is added to the top-level checkAPIs target
7 # NAME: The name of the target, must be unique
8 # SWITCHES: Switches to be supplied to the script
9 # SOURCES: The sources to be checked
11 include(CMakeParseArguments)
14 cmake_parse_arguments(CHECKAPI "DEBUG" "" "NAME;SWITCHES;SOURCES" ${ARGN} )
16 if (CHECKAPI_UNPARSED_ARGUMENTS)
17 message(FATAL_ERROR "CHECKAPIS Unknown argument: ${CHECKAPI_UNPARSED_ARGUMENTS}")
21 set (CHECKAPI_SWITCHES ${CHECKAPI_SWITCHES --debug)
24 set(TARGET_NAME checkAPI_${CHECKAPI_NAME})
25 add_custom_target(${TARGET_NAME}
26 COMMAND ${PERL_EXECUTABLE}
27 ${CMAKE_SOURCE_DIR}/tools/checkAPIs.pl
33 ${CMAKE_CURRENT_SOURCE_DIR}
35 "Running ${TARGET_NAME}"
37 add_dependencies(checkAPI ${TARGET_NAME})
38 set_target_properties(${TARGET_NAME}
39 PROPERTIES FOLDER "Auxiliary/CheckAPIs"
41 EXCLUDE_FROM_DEFAULT_BUILD True