Add build-config.h

build-config.h should contain configure/compile time settings that are
relevant for projects that use FreeRDP.

For example the compiled in plugin search paths.
This commit is contained in:
Bernhard Miklautz 2015-11-05 14:02:07 +01:00
parent 8206ae440f
commit d73c4898c1
13 changed files with 41 additions and 24 deletions

1
.gitignore vendored
View File

@ -20,6 +20,7 @@ LICENSE.txt
*Config.cmake
*ConfigVersion.cmake
include/freerdp/version.h
include/freerdp/build-config.h
*.a.objlist.cmake
*.a.objlist

View File

@ -31,6 +31,7 @@
#include <winpr/collections.h>
#include <freerdp/addin.h>
#include <freerdp/build-config.h>
#include <freerdp/client/channels.h>
#include "tables.h"
@ -181,22 +182,22 @@ FREERDP_ADDIN** freerdp_channels_list_dynamic_addins(LPSTR pszName, LPSTR pszSub
if (pszName && pszSubsystem && pszType)
{
sprintf_s(pszPattern, cchPattern, CMAKE_SHARED_LIBRARY_PREFIX"%s-client-%s-%s.%s",
sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"%s-client-%s-%s.%s",
pszName, pszSubsystem, pszType, pszExtension);
}
else if (pszName && pszType)
{
sprintf_s(pszPattern, cchPattern, CMAKE_SHARED_LIBRARY_PREFIX"%s-client-?-%s.%s",
sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"%s-client-?-%s.%s",
pszName, pszType, pszExtension);
}
else if (pszName)
{
sprintf_s(pszPattern, cchPattern, CMAKE_SHARED_LIBRARY_PREFIX"%s-client*.%s",
sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"%s-client*.%s",
pszName, pszExtension);
}
else
{
sprintf_s(pszPattern, cchPattern, CMAKE_SHARED_LIBRARY_PREFIX"?-client*.%s",
sprintf_s(pszPattern, cchPattern, FREERDP_SHARED_LIBRARY_PREFIX"?-client*.%s",
pszExtension);
}

View File

@ -1,22 +1,6 @@
#ifndef __CONFIG_H
#define __CONFIG_H
#define FREERDP_DATA_PATH "${FREERDP_DATA_PATH}"
#define FREERDP_KEYMAP_PATH "${FREERDP_KEYMAP_PATH}"
#define FREERDP_PLUGIN_PATH "${FREERDP_PLUGIN_PATH}"
#define FREERDP_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
#define FREERDP_LIBRARY_PATH "${FREERDP_LIBRARY_PATH}"
#define FREERDP_ADDIN_PATH "${FREERDP_ADDIN_PATH}"
#define CMAKE_SHARED_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}"
#define CMAKE_SHARED_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}"
#define FREERDP_VENDOR_STRING "${VENDOR}"
#define FREERDP_PRODUCT_STRING "${PRODUCT}"
/* Include files */
#cmakedefine HAVE_FCNTL_H
#cmakedefine HAVE_UNISTD_H

View File

@ -18,10 +18,12 @@
# limitations under the License.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/version.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp/build-config.h)
file(GLOB FREERDP_HEADERS "freerdp/*.h")
install(FILES ${FREERDP_HEADERS} DESTINATION include/freerdp COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp/version.h DESTINATION include/freerdp COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp/build-config.h DESTINATION include/freerdp COMPONENT headers)
install(DIRECTORY freerdp/cache DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h")
install(DIRECTORY freerdp/codec DESTINATION include/freerdp COMPONENT headers FILES_MATCHING PATTERN "*.h")

View File

@ -0,0 +1,20 @@
#ifndef FREERDP_BUILD_CONFIG_H
#define FREERDP_BUILD_CONFIG_H
#define FREERDP_DATA_PATH "${FREERDP_DATA_PATH}"
#define FREERDP_KEYMAP_PATH "${FREERDP_KEYMAP_PATH}"
#define FREERDP_PLUGIN_PATH "${FREERDP_PLUGIN_PATH}"
#define FREERDP_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}"
#define FREERDP_LIBRARY_PATH "${FREERDP_LIBRARY_PATH}"
#define FREERDP_ADDIN_PATH "${FREERDP_ADDIN_PATH}"
#define FREERDP_SHARED_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}"
#define FREERDP_SHARED_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}"
#define FREERDP_VENDOR_STRING "${VENDOR}"
#define FREERDP_PRODUCT_STRING "${PRODUCT}"
#endif /* FREERDP_BUILD_CONFIG_H */

View File

@ -43,6 +43,7 @@
#include <freerdp/constants.h>
#include <freerdp/primitives.h>
#include <freerdp/codec/region.h>
#include <freerdp/build-config.h>
#include "rfx_constants.h"
#include "rfx_types.h"

View File

@ -30,6 +30,7 @@
#include <winpr/library.h>
#include <freerdp/addin.h>
#include <freerdp/build-config.h>
LPSTR freerdp_get_library_install_path()
@ -143,7 +144,7 @@ void* freerdp_load_dynamic_addin(LPCSTR pszFileName, LPCSTR pszPath, LPCSTR pszE
}
else
{
cchAddinFile = cchFileName + cchExt + 2 + sizeof(CMAKE_SHARED_LIBRARY_PREFIX);
cchAddinFile = cchFileName + cchExt + 2 + sizeof(FREERDP_SHARED_LIBRARY_PREFIX);
pszAddinFile = (LPSTR) malloc(cchAddinFile + 1);
if (!pszAddinFile)
{
@ -151,7 +152,7 @@ void* freerdp_load_dynamic_addin(LPCSTR pszFileName, LPCSTR pszPath, LPCSTR pszE
free(pszFilePath);
return NULL;
}
sprintf_s(pszAddinFile, cchAddinFile, CMAKE_SHARED_LIBRARY_PREFIX"%s%s", pszFileName, pszExt);
sprintf_s(pszAddinFile, cchAddinFile, FREERDP_SHARED_LIBRARY_PREFIX"%s%s", pszFileName, pszExt);
cchAddinFile = strlen(pszAddinFile);
}
@ -182,9 +183,9 @@ void* freerdp_load_dynamic_channel_addin_entry(LPCSTR pszName, LPSTR pszSubsyste
{
void* entry;
LPSTR pszFileName;
size_t cchFileName = sizeof(CMAKE_SHARED_LIBRARY_PREFIX) + 32;
size_t cchFileName = sizeof(FREERDP_SHARED_LIBRARY_PREFIX) + 32;
LPCSTR pszExtension;
LPCSTR pszPrefix = CMAKE_SHARED_LIBRARY_PREFIX;
LPCSTR pszPrefix = FREERDP_SHARED_LIBRARY_PREFIX;
pszExtension = PathGetSharedLibraryExtensionA(0);

View File

@ -31,6 +31,7 @@
#include <freerdp/log.h>
#include <freerdp/crypto/tls.h>
#include <freerdp/build-config.h>
#include <winpr/crt.h>
#include <winpr/sam.h>

View File

@ -37,6 +37,7 @@
#include <winpr/registry.h>
#include <freerdp/settings.h>
#include <freerdp/build-config.h>
#include <ctype.h>

View File

@ -23,6 +23,8 @@
#include <stdlib.h>
#include <freerdp/build-config.h>
#include <winpr/tchar.h>
#include <winpr/windows.h>

View File

@ -31,6 +31,7 @@
#include <freerdp/constants.h>
#include <freerdp/channels/wtsvc.h>
#include <freerdp/channels/channels.h>
#include <freerdp/build-config.h>
#include "wf_peer.h"
#include "wf_settings.h"

View File

@ -28,6 +28,7 @@
#include <freerdp/listener.h>
#include <freerdp/codec/rfx.h>
#include <freerdp/build-config.h>
#include "wf_info.h"
#include "wf_input.h"

View File

@ -27,6 +27,7 @@
#include <winpr/tchar.h>
#include <winpr/sysinfo.h>
#include <winpr/registry.h>
#include <freerdp/build-config.h>
#include "ntlm.h"
#include "../sspi.h"