File: UseCheckAPI.cmake

package info (click to toggle)
wireshark 4.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 351,436 kB
  • sloc: ansic: 3,103,613; cpp: 129,736; xml: 100,978; python: 56,510; perl: 24,575; sh: 5,874; lex: 4,383; pascal: 4,304; makefile: 164; ruby: 113; objc: 91; tcl: 35
file content (43 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Add a target to call checkAPIs.pl on the specified source files
# The target is excluded from the ALL targte so must be manually
# specified in a build command.
# The target is added to the top-level checkAPIs target
#
# Parameters:
#   NAME: 	The name of the target, must be unique
#   SWITCHES:	Switches to be supplied to the script
#   SOURCES:	The sources to be checked

include(CMakeParseArguments)

macro( CHECKAPI )
	cmake_parse_arguments(CHECKAPI "DEBUG" "" "NAME;SWITCHES;SOURCES" ${ARGN} )

	if (CHECKAPI_UNPARSED_ARGUMENTS)
		message(FATAL_ERROR "CHECKAPIS Unknown argument: ${CHECKAPI_UNPARSED_ARGUMENTS}")
	endif()

	if( CHECKAPI_DEBUG )
		set (CHECKAPI_SWITCHES ${CHECKAPI_SWITCHES --debug)
	endif()

	set(TARGET_NAME checkAPI_${CHECKAPI_NAME})
	add_custom_target(${TARGET_NAME}
		COMMAND ${PERL_EXECUTABLE}
		  ${CMAKE_SOURCE_DIR}/tools/checkAPIs.pl
		  ${CHECKAPI_SWITCHES}
		  ${CHECKAPI_SOURCES}
		DEPENDS
		  ${CHECKAPI_SOURCES}
		WORKING_DIRECTORY
		  ${CMAKE_CURRENT_SOURCE_DIR}
		COMMENT
		  "Running ${TARGET_NAME}"
	)
	add_dependencies(checkAPI ${TARGET_NAME})
	set_target_properties(${TARGET_NAME}
		PROPERTIES FOLDER "Auxiliary/CheckAPIs"
		EXCLUDE_FROM_ALL True
		EXCLUDE_FROM_DEFAULT_BUILD True
	)
ENDMACRO()