mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Improvements to CMake configuration for the binary distribution (issue #1404).
- Add LIBCEF_APPEND_PLATFORM_SOURCES macro definition in libcef_dll/CMakeLists.txt to remove dependency on macros.cmake. - Don't add the default "lib" prefix to the libcef_dll_wrapper output library name. - Fix a documentation error in CMakeLists.txt. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1886 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -26,7 +26,7 @@
|
|||||||
#
|
#
|
||||||
# CMakeLists.txt Bootstrap that sets up the CMake environment and
|
# CMakeLists.txt Bootstrap that sets up the CMake environment and
|
||||||
# loads the other CMake files.
|
# loads the other CMake files.
|
||||||
# cmake.macros Helper macros for building a generic CEF-based
|
# macros.cmake Helper macros for building a generic CEF-based
|
||||||
# application.
|
# application.
|
||||||
# libcef_dll/CMakeLists.txt Defines the libcef_dll_wrapper target.
|
# libcef_dll/CMakeLists.txt Defines the libcef_dll_wrapper target.
|
||||||
# cefclient/CMakeLists.txt Defines the cefclient target.
|
# cefclient/CMakeLists.txt Defines the cefclient target.
|
||||||
|
@ -4,9 +4,27 @@
|
|||||||
|
|
||||||
add_definitions(-DUSING_CEF_SHARED)
|
add_definitions(-DUSING_CEF_SHARED)
|
||||||
|
|
||||||
|
# Append platform specific sources to a list of sources.
|
||||||
|
# Should be kept synchronized with APPEND_PLATFORM_SOURCES from macros.cmake.
|
||||||
|
macro(LIBCEF_APPEND_PLATFORM_SOURCES name_of_list)
|
||||||
|
if(OS_LINUX AND ${name_of_list}_LINUX)
|
||||||
|
list(APPEND ${name_of_list} ${${name_of_list}_LINUX})
|
||||||
|
endif()
|
||||||
|
if(OS_POSIX AND ${name_of_list}_POSIX)
|
||||||
|
list(APPEND ${name_of_list} ${${name_of_list}_POSIX})
|
||||||
|
endif()
|
||||||
|
if(OS_WINDOWS AND ${name_of_list}_WINDOWS)
|
||||||
|
list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS})
|
||||||
|
endif()
|
||||||
|
if(OS_MACOSX AND ${name_of_list}_MACOSX)
|
||||||
|
list(APPEND ${name_of_list} ${${name_of_list}_MACOSX})
|
||||||
|
endif()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
{{
|
{{
|
||||||
'prefix': 'libcef',
|
'prefix': 'libcef',
|
||||||
'library': 'libcef_dll_wrapper',
|
'library': 'libcef_dll_wrapper',
|
||||||
|
'append_macro': 'LIBCEF_APPEND_PLATFORM_SOURCES',
|
||||||
'includes': [
|
'includes': [
|
||||||
'includes_common',
|
'includes_common',
|
||||||
'autogen_cpp_includes',
|
'autogen_cpp_includes',
|
||||||
@ -20,3 +38,6 @@ add_definitions(-DUSING_CEF_SHARED)
|
|||||||
'autogen_client_side',
|
'autogen_client_side',
|
||||||
],
|
],
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
# Remove the default "lib" prefix from the resulting library.
|
||||||
|
set_target_properties(libcef_dll_wrapper PROPERTIES PREFIX "")
|
||||||
|
@ -48,7 +48,7 @@ def format_cmake_set(name, values):
|
|||||||
result += ' %s\n' % value
|
result += ' %s\n' % value
|
||||||
return result + ' )\n'
|
return result + ' )\n'
|
||||||
|
|
||||||
def format_cmake_group(cmake_path, name, files, platform_sep):
|
def format_cmake_group(cmake_path, name, files, platform_sep, append_macro):
|
||||||
platforms = {}
|
platforms = {}
|
||||||
common = []
|
common = []
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ def format_cmake_group(cmake_path, name, files, platform_sep):
|
|||||||
keys = sorted(platforms.keys())
|
keys = sorted(platforms.keys())
|
||||||
for key in keys:
|
for key in keys:
|
||||||
result += format_cmake_set(name + '_' + key, platforms[key])
|
result += format_cmake_set(name + '_' + key, platforms[key])
|
||||||
result += 'APPEND_PLATFORM_SOURCES(%s)\n' % name
|
result += '%s(%s)\n' % (append_macro, name)
|
||||||
|
|
||||||
result += 'source_group(%s FILES ${%s})\n\n' % (folder, name)
|
result += 'source_group(%s FILES ${%s})\n\n' % (folder, name)
|
||||||
return result
|
return result
|
||||||
@ -105,6 +105,7 @@ def process_cmake_template_segment(segment, segment_ct, cmake_path, variables):
|
|||||||
includes = []
|
includes = []
|
||||||
suffix = '_SRCS' # Appended to each group name before the platform name.
|
suffix = '_SRCS' # Appended to each group name before the platform name.
|
||||||
platform_sep = ':' # Used to separate value from platform name.
|
platform_sep = ':' # Used to separate value from platform name.
|
||||||
|
append_macro = 'APPEND_PLATFORM_SOURCES' # CMake macro name.
|
||||||
|
|
||||||
# Extract values from |segment|. Example |segment| contents:
|
# Extract values from |segment|. Example |segment| contents:
|
||||||
# 'prefix': 'cefsimple',
|
# 'prefix': 'cefsimple',
|
||||||
@ -126,6 +127,9 @@ def process_cmake_template_segment(segment, segment_ct, cmake_path, variables):
|
|||||||
if 'set' in values:
|
if 'set' in values:
|
||||||
set = values['set']
|
set = values['set']
|
||||||
|
|
||||||
|
if 'append_macro' in values:
|
||||||
|
append_macro = values['append_macro']
|
||||||
|
|
||||||
if 'includes' in values and len(values['includes']) > 0:
|
if 'includes' in values and len(values['includes']) > 0:
|
||||||
for include in values['includes']:
|
for include in values['includes']:
|
||||||
parts = include.strip().split(platform_sep)
|
parts = include.strip().split(platform_sep)
|
||||||
@ -163,7 +167,7 @@ def process_cmake_template_segment(segment, segment_ct, cmake_path, variables):
|
|||||||
for key in keys:
|
for key in keys:
|
||||||
# Add a group of files that share the same path.
|
# Add a group of files that share the same path.
|
||||||
result += format_cmake_group(cmake_path, key + suffix, groups[key], \
|
result += format_cmake_group(cmake_path, key + suffix, groups[key], \
|
||||||
platform_sep)
|
platform_sep, append_macro)
|
||||||
|
|
||||||
if not library is None:
|
if not library is None:
|
||||||
# Add the library declaration if requested.
|
# Add the library declaration if requested.
|
||||||
|
Reference in New Issue
Block a user