File: UseExecutableResources.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 (26 lines) | stat: -rw-r--r-- 1,219 bytes parent folder | download | duplicates (4)
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
# Sets RC information on Windows.
# UNIQUE_RC - Use if the program has its own .rc.in file. Otherwise cli_template.rc.in will be used.
# EXE_NAME - The lowercase executable base name.
# PROGRAM_NAME - The program's proper, capitalized name.
# COPYRIGHT_INFO - Year followed by copyright holder names if different from default.
function(set_executable_resources EXE_NAME PROGRAM_NAME)
	if (WIN32)
		set(options UNIQUE_RC)
		set(one_value_args COPYRIGHT_INFO)
		cmake_parse_arguments(EXE_RC "${options}" "${one_value_args}" "" ${ARGN} )
		if (EXE_RC_COPYRIGHT_INFO)
			set(COPYRIGHT_INFO "${EXE_RC_COPYRIGHT_INFO}")
		else()
			# Use the original Wireshark / TShark .rc copyright.
			set(COPYRIGHT_INFO "2000 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and many others")
		endif()
		set(${EXE_NAME}_FILES ${${EXE_NAME}_FILES} ${CMAKE_BINARY_DIR}/resources/${EXE_NAME}.rc PARENT_SCOPE)
		if (EXE_RC_UNIQUE_RC)
			set (_in_file ${EXE_NAME})
		else()
			set (_in_file "cli_template")
		endif()
		set(ICON_PATH "${CMAKE_SOURCE_DIR}/resources/icons/")
		configure_file( ${CMAKE_SOURCE_DIR}/resources/${_in_file}.rc.in ${CMAKE_BINARY_DIR}/resources/${EXE_NAME}.rc @ONLY )
	endif()
endfunction()