Using vendor/product scheme for settings now.

This commit is contained in:
Armin Novak 2015-06-02 09:07:17 +02:00
parent d1223d3799
commit 8f68b9c261
3 changed files with 19 additions and 6 deletions

View File

@ -26,6 +26,10 @@ if(NOT DEFINED VENDOR)
set(VENDOR "FreeRDP" CACHE STRING "FreeRDP package vendor") set(VENDOR "FreeRDP" CACHE STRING "FreeRDP package vendor")
endif() endif()
if(NOT DEFINED PRODUCT)
set(PRODUCT "FreeRDP" CACHE STRING "FreeRDP package name")
endif()
if(NOT DEFINED FREERDP_VENDOR) if(NOT DEFINED FREERDP_VENDOR)
set(FREERDP_VENDOR 1) set(FREERDP_VENDOR 1)
endif() endif()
@ -284,8 +288,8 @@ if(WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWIN32_LEAN_AND_MEAN")
# Set product and vendor for dll and exe version information. # Set product and vendor for dll and exe version information.
set(RC_VERSION_VENDOR "FreeRDP") set(RC_VERSION_VENDOR ${VENDOR})
set(RC_VERSION_PRODUCT "FreeRDP") set(RC_VERSION_PRODUCT ${PRODUCT})
set(RC_VERSION_PATCH ${BUILD_NUMBER}) set(RC_VERSION_PATCH ${BUILD_NUMBER})
set(RC_VERSION_DESCRIPTION ${GIT_REVISION}) set(RC_VERSION_DESCRIPTION ${GIT_REVISION})

View File

@ -14,6 +14,9 @@
#define CMAKE_SHARED_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}" #define CMAKE_SHARED_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}"
#define CMAKE_SHARED_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}" #define CMAKE_SHARED_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}"
#define FREERDP_VENDOR_STRING "${VENDOR}"
#define FREERDP_PRODUCT_STRING "${PRODUCT}"
/* Include files */ /* Include files */
#cmakedefine HAVE_FCNTL_H #cmakedefine HAVE_FCNTL_H
#cmakedefine HAVE_UNISTD_H #cmakedefine HAVE_UNISTD_H

View File

@ -202,6 +202,7 @@ void settings_get_computer_name(rdpSettings* settings)
rdpSettings* freerdp_settings_new(DWORD flags) rdpSettings* freerdp_settings_new(DWORD flags)
{ {
char* base;
rdpSettings* settings; rdpSettings* settings;
settings = (rdpSettings*) calloc(1, sizeof(rdpSettings)); settings = (rdpSettings*) calloc(1, sizeof(rdpSettings));
@ -471,7 +472,12 @@ rdpSettings* freerdp_settings_new(DWORD flags)
settings->HomePath = GetKnownPath(KNOWN_PATH_HOME); settings->HomePath = GetKnownPath(KNOWN_PATH_HOME);
if (!settings->HomePath) if (!settings->HomePath)
goto out_fail; goto out_fail;
settings->ConfigPath = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME, "freerdp"); base = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME,
FREERDP_VENDOR_STRING);
if (base)
settings->ConfigPath = GetCombinedPath(base, FREERDP_PRODUCT_STRING);
free (base);
if (!settings->ConfigPath) if (!settings->ConfigPath)
goto out_fail; goto out_fail;