File: CMakeVCManifest.cmake

package info (click to toggle)
cmake 2.4.5-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 16,804 kB
  • ctags: 18,861
  • sloc: cpp: 84,497; ansic: 84,379; yacc: 3,136; sh: 1,970; lex: 1,004; lisp: 119; makefile: 89; xml: 88; perl: 60; tcl: 55; python: 25; php: 25; ruby: 22; java: 20; f90: 19; fortran: 3
file content (30 lines) | stat: -rw-r--r-- 999 bytes parent folder | download
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

# Leave the first line of this file empty so this module will not be
# included in the documentation.

# This script is invoked from Windows-cl.cmake and passed the TARGET
# variable on the command line.

# Conditionally embed the manifest in the executable if it exists.
IF(EXISTS "${TARGET}.manifest")
  # Construct the manifest embedding command.
  SET(CMD
    mt ${CMAKE_CL_NOLOGO} /manifest ${TARGET}.manifest
    /outputresource:${TARGET}
    )

  # Run the embedding command.
  EXECUTE_PROCESS(COMMAND ${CMD}\;\#2 RESULT_VARIABLE RESULT)

  # Check whether the command failed.
  IF(NOT "${RESULT}" MATCHES "^0$")
    # The embedding failed remove the target and the manifest.
    FILE(REMOVE ${TARGET} ${TARGET}.manifest)

    # Describe the failure in a message.
    STRING(REGEX REPLACE ";" " " CMD "${CMD}")
    MESSAGE(FATAL_ERROR
      "Failed to embed manifest in ${TARGET} using command \"${CMD};#2\""
      )
  ENDIF(NOT "${RESULT}" MATCHES "^0$")
ENDIF(EXISTS "${TARGET}.manifest")