]> granicus.if.org Git - transmission/commitdiff
Add version info to executables (on Windows). Group projects into folders (CMake).
authorMike Gelfand <mikedld@mikedld.com>
Tue, 14 Apr 2015 22:46:40 +0000 (22:46 +0000)
committerMike Gelfand <mikedld@mikedld.com>
Tue, 14 Apr 2015 22:46:40 +0000 (22:46 +0000)
CMakeLists.txt
cli/CMakeLists.txt
cmake/TrMacros.cmake
cmake/Transmission.rc.in [new file with mode: 0644]
daemon/CMakeLists.txt
gtk/CMakeLists.txt
libtransmission/CMakeLists.txt
qt/CMakeLists.txt
utils/CMakeLists.txt

index 1e7d4ececbdeb131386cdd2833042a3f55cfa543..6c37b73ca88202079a7cf8b6cf861938535c32c0 100644 (file)
@@ -92,6 +92,8 @@ if("${TR_SCM_REVISION}" STREQUAL "")
     set(TR_SCM_REVISION 0)
 endif()
 
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
 set(CURL_MINIMUM            7.15.4)
 set(EVENT2_MINIMUM          2.0.10)
 set(OPENSSL_MINIMUM         0.9.4)
index 0928314d97b00705e90061614b3292b9edda7b04..a2c97f6b22a206e1dff76cf87c65177143a4d46d 100644 (file)
@@ -2,7 +2,12 @@ project(trcli)
 
 include_directories(${CMAKE_SOURCE_DIR})
 
-add_executable(${TR_NAME}-cli cli.c)
+tr_win32_app_info(${PROJECT_NAME}_WIN32_RC_FILE
+    "Transmission Utility ('cli', obsolete)"
+    "${TR_NAME}-cli"
+    "${TR_NAME}-cli.exe")
+
+add_executable(${TR_NAME}-cli cli.c ${${PROJECT_NAME}_WIN32_RC_FILE})
 include_directories(${TR_NAME}-cli ${CURL_INCLUDE_DIRS})
 target_link_libraries(${TR_NAME}-cli ${TR_NAME})
 
index e058ddb35a2c4ff9fd0e35080b1dd4810fb640ae..51eb11c15974b3dfd294ee1342a3472f55188f79 100644 (file)
@@ -104,6 +104,8 @@ macro(tr_add_external_auto_library ID LIBNAME)
                 "-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>"
         )
 
+        set_property(TARGET ${${ID}_UPSTREAM_TARGET} PROPERTY FOLDER "ThirdParty")
+
         set(${ID}_INCLUDE_DIR "${${ID}_PREFIX}/include" CACHE INTERNAL "")
         set(${ID}_LIBRARY "${${ID}_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${LIBNAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" CACHE INTERNAL "")
 
@@ -119,3 +121,20 @@ function(tr_append_target_property TGT PROP VAL)
     endif()
     set_target_properties(${TGT} PROPERTIES ${PROP} "${VAL}")
 endfunction()
+
+function(tr_win32_app_info OVAR DESCR INTNAME ORIGFNAME)
+    if(NOT WIN32)
+        return()
+    endif()
+
+    set(TR_FILE_DESCRIPTION "${DESCR}")
+    set(TR_INTERNAL_NAME "${INTNAME}")
+    set(TR_ORIGINAL_FILENAME "${ORIGFNAME}")
+    if(ARGN)
+        set(TR_MAIN_ICON "${ARGN}")
+    endif()
+
+    configure_file("${CMAKE_SOURCE_DIR}/cmake/Transmission.rc.in" "${INTNAME}.rc")
+
+    set(${OVAR} "${CMAKE_CURRENT_BINARY_DIR}/${INTNAME}.rc" PARENT_SCOPE)
+endfunction()
diff --git a/cmake/Transmission.rc.in b/cmake/Transmission.rc.in
new file mode 100644 (file)
index 0000000..2e47e14
--- /dev/null
@@ -0,0 +1,51 @@
+#include "winresrc.h"
+#include <libtransmission/version.h>
+
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+
+#pragma code_page(1252)
+
+#ifdef TR_STABLE_RELEASE
+ #define TR_FF_PRERELEASE 0x0L
+#else
+ #define TR_FF_PRERELEASE VS_FF_PRERELEASE
+#endif
+
+VS_VERSION_INFO VERSIONINFO
+    FILEVERSION    MAJOR_VERSION, MINOR_VERSION, 0, 0
+    PRODUCTVERSION MAJOR_VERSION, MINOR_VERSION, 0, 0
+    FILEFLAGSMASK  VS_FF_DEBUG | TR_FF_PRERELEASE
+#ifdef _DEBUG
+    FILEFLAGS      VS_FF_DEBUG | TR_FF_PRERELEASE
+#else
+    FILEFLAGS      0x0L
+#endif
+    FILEOS         VOS_NT_WINDOWS32
+    FILETYPE       VFT_APP
+    FILESUBTYPE    VFT2_UNKNOWN
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "CompanyName",      "Transmission Project"
+            VALUE "FileDescription",  "${TR_FILE_DESCRIPTION}"
+            VALUE "FileVersion",      LONG_VERSION_STRING
+            VALUE "InternalName",     "${TR_INTERNAL_NAME}"
+            VALUE "LegalCopyright",   "2005-2015 Transmission Project"
+            VALUE "OriginalFilename", "${TR_ORIGINAL_FILENAME}"
+            VALUE "ProductName",      "Transmission"
+            VALUE "ProductVersion",   LONG_VERSION_STRING
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x0400, 1200
+    END
+END
+
+#cmakedefine TR_MAIN_ICON "${TR_MAIN_ICON}"
+
+#ifdef TR_MAIN_ICON
+MAINICON ICON TR_MAIN_ICON
+#endif
index 2325ef43562acb3f87154671055434fda6d17e88..763ae64788c40aafd36c966625c7656eeddd22dd 100644 (file)
@@ -34,7 +34,15 @@ set(${PROJECT_NAME}_HEADERS
     watch.h
 )
 
-add_executable(${TR_NAME}-daemon ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
+tr_win32_app_info(${PROJECT_NAME}_WIN32_RC_FILE
+    "Transmission Daemon"
+    "${TR_NAME}-daemon"
+    "${TR_NAME}-daemon.exe")
+
+add_executable(${TR_NAME}-daemon
+    ${${PROJECT_NAME}_SOURCES}
+    ${${PROJECT_NAME}_HEADERS}
+    ${${PROJECT_NAME}_WIN32_RC_FILE})
 
 set_target_properties(${TR_NAME}-daemon PROPERTIES
     COMPILE_FLAGS "${SYSTEMD_DAEMON_CFLAGS}"
@@ -46,7 +54,12 @@ target_link_libraries(${TR_NAME}-daemon
     ${EVENT2_LIBRARIES}
 )
 
-add_executable(${TR_NAME}-remote remote.c)
+tr_win32_app_info(${PROJECT_NAME}_remote_WIN32_RC_FILE
+    "Transmission Utility ('remote')"
+    "${TR_NAME}-remote"
+    "${TR_NAME}-remote.exe")
+
+add_executable(${TR_NAME}-remote remote.c ${${PROJECT_NAME}_remote_WIN32_RC_FILE})
 
 target_link_libraries(${TR_NAME}-remote
     ${TR_NAME}
index 9a2bf109ca11fd22a3d327f310316d1f86dbea9a..94224c5deab91d8a0429441716e3821d136fe591 100644 (file)
@@ -135,10 +135,17 @@ add_definitions(
     ${GTK_CFLAGS_OTHER}
 )
 
+tr_win32_app_info(${PROJECT_NAME}_WIN32_RC_FILE
+    "Transmission GTK+ Client"
+    "${TR_NAME}-gtk"
+    "${TR_NAME}-gtk.exe"
+    "${TR_NAME}.ico")
+
 add_executable(${TR_NAME}-gtk WIN32
     ${${PROJECT_NAME}_SOURCES}
     ${${PROJECT_NAME}_HEADERS}
     ${${PROJECT_NAME}_DESKTOP_FILE}
+    ${${PROJECT_NAME}_WIN32_RC_FILE}
 )
 
 target_link_libraries(${TR_NAME}-gtk
index 87997c4650aa725d03efac96acee9546d15207cc..5e6856211862679d20f4e521f86bad562506f119 100644 (file)
@@ -224,6 +224,7 @@ if(ENABLE_TESTS)
     )
 
     target_link_libraries(${TR_NAME}-test ${TR_NAME})
+    set_property(TARGET ${TR_NAME}-test PROPERTY FOLDER "UnitTests")
 
     set(crypto-test_ADD_SOURCES crypto-test-ref.h)
 
@@ -232,6 +233,7 @@ if(ENABLE_TESTS)
         add_executable(${TP} ${T}-test.c ${${T}-test_ADD_SOURCES})
         target_link_libraries(${TP} ${TR_NAME} ${TR_NAME}-test)
         add_test(${T} ${TP})
+        set_property(TARGET ${TP} PROPERTY FOLDER "UnitTests")
     endforeach()
 endif()
 
index 4eb7b62ce5ab611101242f05af679a21d78921aa..ceaec3c581017cf846ea4a68f79f982d71cd3b42 100644 (file)
@@ -167,12 +167,19 @@ add_definitions(
     -DQT_NO_CAST_FROM_ASCII
 )
 
+tr_win32_app_info(${PROJECT_NAME}_WIN32_RC_FILE
+    "Transmission Qt Client"
+    "transmission-qt"
+    "transmission-qt.exe"
+    "qtr.ico")
+
 add_executable(${TR_NAME}-qt WIN32
     ${${PROJECT_NAME}_SOURCES}
     ${${PROJECT_NAME}_UI_SOURCES}
     ${${PROJECT_NAME}_QRC_SOURCES}
     ${${PROJECT_NAME}_HEADERS}
     ${${PROJECT_NAME}_QM_FILES}
+    ${${PROJECT_NAME}_WIN32_RC_FILE}
 )
 
 target_link_libraries(${TR_NAME}-qt
index 37eace9f79adfc99f7c380ba951520e0a8d1b9e0..7528fe1bdf38efd12451f779896d6d2ebf047dfc 100644 (file)
@@ -3,7 +3,12 @@ project(trutils)
 include_directories(${CMAKE_SOURCE_DIR})
 
 foreach(P create edit show)
-    add_executable(${TR_NAME}-${P} ${P}.c)
+    tr_win32_app_info(${PROJECT_NAME}_${P}_WIN32_RC_FILE
+        "Transmission Utility ('${P}')"
+        "${TR_NAME}-${P}"
+        "${TR_NAME}-${P}.exe")
+
+    add_executable(${TR_NAME}-${P} ${P}.c ${${PROJECT_NAME}_${P}_WIN32_RC_FILE})
     include_directories(${TR_NAME}-${P} ${EVENT2_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS})
     target_link_libraries(${TR_NAME}-${P} ${TR_NAME})