File: ManageTarget.cmake

package info (click to toggle)
ibus-table-chinese 1.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 29,812 kB
  • sloc: sh: 106; makefile: 11
file content (40 lines) | stat: -rw-r--r-- 1,417 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
# - Modules for managing targets and outputs.
#
# Defines following macros:
#   ADD_CUSTOM_TARGET_COMMAND(target OUTPUT file1 [file2 ..] COMMAND
#   command1 ...)
#   - Combine ADD_CUSTOM_TARGET and ADD_CUSTOM_COMMAND.
#     Always build when making the target, also specify the output files
#     Arguments:
#     + target: target for this command
#     + file1, file2 ... : Files to be outputted by this command
#     + command1 ... : Command to be run. The rest arguments are same with
#                      ADD_CUSTOM_TARGET.
#

IF(NOT DEFINED _MANAGE_TARGET_CMAKE_)
    SET(_MANAGE_TARGET_CMAKE_ "DEFINED")
    MACRO(ADD_CUSTOM_TARGET_COMMAND target OUTPUT)
	SET(_outputFileList "")
	SET(_optionList "")
	SET(_outputFileMode 1)
	FOREACH(_t ${ARGN})
	    IF(_outputFileMode)
		IF(_t STREQUAL "COMMAND")
		    SET(_outputFileMode 0)
		    LIST(APPEND _optionList "${_t}")
		ELSE(_t STREQUAL "COMMAND")
		    LIST(APPEND _outputFileList "${_t}")
		ENDIF(_t STREQUAL "COMMAND")
	    ELSE(_outputFileMode)
		LIST(APPEND _optionList "${_t}")
	    ENDIF(_outputFileMode)
	ENDFOREACH(_t ${ARGN})
	#MESSAGE("ADD_CUSTOM_TARGET(${target} ${_optionList})")
	ADD_CUSTOM_TARGET(${target} ${_optionList})
	#MESSAGE("ADD_CUSTOM_COMMAND(OUTPUT ${_outputFileList}  ${_optionList})")
	ADD_CUSTOM_COMMAND(OUTPUT ${_outputFileList}  ${_optionList})
    ENDMACRO(ADD_CUSTOM_TARGET_COMMAND)

ENDIF(NOT DEFINED _MANAGE_TARGET_CMAKE_)