diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-10-08 16:34:39 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2018-10-10 15:40:21 +0000 |
commit | 573e8420027377cce79750b85f416c3b9a740968 (patch) | |
tree | 621fb48b7128d83af549d6377258f3fefaebf895 /cmake/modules | |
parent | b7107f5fcb9bcc20be33b6263f90d1b20cc1591d (diff) |
Windows: Make our program details more consistent.
Use a single template file for most of our program resources. Encode
our resource files as UTF-8. Add resources to extcap/*.exe.
Replace a regex with concatenation.
Change-Id: I0ed49086618127ca4fdef69272f849d8f16e4dab
Reviewed-on: https://code.wireshark.org/review/30088
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/UseExecutableResources.cmake | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/modules/UseExecutableResources.cmake b/cmake/modules/UseExecutableResources.cmake new file mode 100644 index 0000000000..ebc01ae227 --- /dev/null +++ b/cmake/modules/UseExecutableResources.cmake @@ -0,0 +1,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_HOLDERS - 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_HOLDERS) + 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}/image/${EXE_NAME}.rc PARENT_SCOPE) + if (EXE_RC_UNIQUE) + set (_in_file ${EXE_NAME}) + else() + set (_in_file "cli_template") + endif() + set(ICON_PATH "${CMAKE_SOURCE_DIR}/image/") + configure_file( ${CMAKE_SOURCE_DIR}/image/${_in_file}.rc.in ${CMAKE_BINARY_DIR}/image/${EXE_NAME}.rc @ONLY ) + endif() +endfunction() |