summaryrefslogtreecommitdiffstats
path: root/cmake/modules/UseExecutableResources.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:34:10 +0000
commite4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch)
tree68cb5ef9081156392f1dd62a00c6ccc1451b93df /cmake/modules/UseExecutableResources.cmake
parentInitial commit. (diff)
downloadwireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz
wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/UseExecutableResources.cmake')
-rw-r--r--cmake/modules/UseExecutableResources.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/modules/UseExecutableResources.cmake b/cmake/modules/UseExecutableResources.cmake
new file mode 100644
index 0000000..8eeb4a7
--- /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_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()