Created
July 15, 2014 14:43
-
-
Save BtbN/2f1d6a2366f8a9836a46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string(REGEX REPLACE "\\.(dll|exe)$" ".pdb" FNAME "${FNAME}") | |
if(CONFIG STREQUAL Debug OR CONFIG STREQUAL RelWithDebInfo) | |
file(COPY "${INPUT}/${FNAME}" DESTINATION "${OUTPUT}") | |
elseif(EXISTS "${OUTPUT}/${FNAME}") | |
file(REMOVE "${OUTPUT}/${FNAME}") | |
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(obs_debug_copy_helper target dest) | |
add_custom_command(TARGET ${target} POST_BUILD | |
COMMAND "${CMAKE_COMMAND}" | |
"-DCONFIG=$<CONFIGURATION>" | |
"-DFNAME=$<TARGET_FILE_NAME:${target}>" | |
"-DINPUT=$<TARGET_FILE_DIR:${target}>" | |
"-DOUTPUT=${dest}" | |
-P "${CMAKE_SOURCE_DIR}/cmake/copy_on_debug_helper.cmake" | |
VERBATIM) | |
endfunction() | |
function(install_obs_pdb ttype target) | |
if(NOT MSVC) | |
return() | |
endif() | |
if(CMAKE_SIZEOF_VOID_P EQUAL 8) | |
set(_bit_suffix "64bit") | |
else() | |
set(_bit_suffix "32bit") | |
endif() | |
obs_debug_copy_helper(${target} "${CMAKE_CURRENT_BINARY_DIR}/pdbs") | |
if("${ttype}" STREQUAL "PLUGIN") | |
obs_debug_copy_helper(${target} "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/obs-plugins/${_bit_suffix}") | |
if(DEFINED ENV{obsInstallerTempDir}) | |
obs_debug_copy_helper(${target} "$ENV{obsInstallerTempDir}/${OBS_EXECUTABLE_DESTINATION}") | |
endif() | |
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pdbs/${tgt_out_name}.pdb" | |
DESTINATION "${OBS_EXECUTABLE_DESTINATION}" | |
CONFIGURATIONS Debug RelWithDebInfo) | |
else() | |
obs_debug_copy_helper(${target} "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/bin/${_bit_suffix}") | |
if(DEFINED ENV{obsInstallerTempDir}) | |
obs_debug_copy_helper(${target} "$ENV{obsInstallerTempDir}/${OBS_PLUGIN_DESTINATION}") | |
endif() | |
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pdbs/${tgt_out_name}.pdb" | |
DESTINATION "${OBS_PLUGIN_DESTINATION}" | |
CONFIGURATIONS Debug RelWithDebInfo) | |
endif() | |
endfunction() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment