mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-09 00:28:59 +01:00
Improve binary distribution CMake macros (issue #1923)
This commit is contained in:
parent
eb199b2547
commit
f5b910326d
@ -81,11 +81,15 @@ endmacro()
|
|||||||
|
|
||||||
# Determine the target output directory based on platform and generator.
|
# Determine the target output directory based on platform and generator.
|
||||||
macro(SET_CEF_TARGET_OUT_DIR)
|
macro(SET_CEF_TARGET_OUT_DIR)
|
||||||
if(${CMAKE_GENERATOR} STREQUAL "Ninja")
|
if(${CMAKE_GENERATOR} STREQUAL "Ninja" OR
|
||||||
# Ninja does not create a subdirectory named after the configuration.
|
${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
||||||
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
|
# By default Ninja and Make builds don't create a subdirectory named after
|
||||||
elseif(OS_LINUX)
|
# the configuration.
|
||||||
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
|
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
|
# Output binaries (executables, libraries) to the correct directory.
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR})
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR})
|
||||||
else()
|
else()
|
||||||
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
|
set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>")
|
||||||
endif()
|
endif()
|
||||||
@ -256,13 +260,13 @@ endif(OS_MACOSX)
|
|||||||
if(OS_WINDOWS)
|
if(OS_WINDOWS)
|
||||||
|
|
||||||
# Add custom manifest files to an executable target.
|
# Add custom manifest files to an executable target.
|
||||||
macro(ADD_WINDOWS_MANIFEST manifest_path target)
|
macro(ADD_WINDOWS_MANIFEST manifest_path target extension)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${target}
|
TARGET ${target}
|
||||||
POST_BUILD
|
POST_BUILD
|
||||||
COMMAND "mt.exe" -nologo
|
COMMAND "mt.exe" -nologo
|
||||||
-manifest \"${manifest_path}/${target}.exe.manifest\" \"${manifest_path}/compatibility.manifest\"
|
-manifest \"${manifest_path}/${target}.${extension}.manifest\" \"${manifest_path}/compatibility.manifest\"
|
||||||
-outputresource:"${CEF_TARGET_OUT_DIR}/${target}.exe"\;\#1
|
-outputresource:"${CEF_TARGET_OUT_DIR}/${target}.${extension}"\;\#1
|
||||||
COMMENT "Adding manifest..."
|
COMMENT "Adding manifest..."
|
||||||
)
|
)
|
||||||
endmacro()
|
endmacro()
|
||||||
|
@ -246,7 +246,7 @@ if(OS_WINDOWS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add the custom manifest files to the executable.
|
# Add the custom manifest files to the executable.
|
||||||
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}/resources/win" "${CEF_TARGET}")
|
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}/resources/win" "${CEF_TARGET}" "exe")
|
||||||
|
|
||||||
# Copy CEF binary and resource files to the target output directory.
|
# Copy CEF binary and resource files to the target output directory.
|
||||||
COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
|
COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
|
||||||
|
@ -157,7 +157,7 @@ if(OS_WINDOWS)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Add the custom manifest files to the executable.
|
# Add the custom manifest files to the executable.
|
||||||
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_TARGET}")
|
ADD_WINDOWS_MANIFEST("${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_TARGET}" "exe")
|
||||||
|
|
||||||
# Copy binary and resource files to the target output directory.
|
# Copy binary and resource files to the target output directory.
|
||||||
COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
|
COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user