Have DLL project run ModOrganizer.exe from install by default for debugging.

This commit is contained in:
Mikaël Capelle
2020-05-20 16:55:25 +02:00
parent b4a0c68124
commit 985d603687
+22
View File
@@ -9,6 +9,27 @@ if(NOT DEFINED install_dir)
endif()
endif()
function(set_project_to_run_from_install)
set(vcxproj_user_file "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.vcxproj.user")
get_target_property(output_name ${PROJECT_NAME} OUTPUT_NAME)
if("${output_name}" STREQUAL "output_name-NOTFOUND")
set(output_name ${PROJECT_NAME})
endif()
if(NOT EXISTS ${vcxproj_user_file})
file(WRITE ${vcxproj_user_file}
"<?xml version=\"1.0\" encoding=\"utf-8\"?>
<Project ToolsVersion=\"Current\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">
<PropertyGroup>
<LocalDebuggerWorkingDirectory>${CMAKE_INSTALL_PREFIX}/bin</LocalDebuggerWorkingDirectory>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommand>${CMAKE_INSTALL_PREFIX}/bin/ModOrganizer.exe</LocalDebuggerCommand>
</PropertyGroup>
</Project>")
endif()
endfunction()
macro(do_project)
do_cpp_project()
endmacro()
@@ -26,5 +47,6 @@ macro(do_src)
install(FILES $<TARGET_PDB_FILE:${PROJECT_NAME}>
DESTINATION pdb)
set_project_to_run_from_install()
cpp_post_target()
endmacro()