add_custom_target(NSISTest_Preprocess SOURCES precompress.nsi)
add_custom_command(TARGET NSISTest_Preprocess POST_BUILD
COMMAND \"${NSIS_PATH}\" \"...\\\\precompress.n
The .user
settings approach also works for custom targets. You could just add - if the path is known - the installer's .exe
as a command the debugger should call with 'Debug->Start Debugging'.
VS2010Test-Debug.vcxproj.user.in
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommand>${_my_installer_path}</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
</PropertyGroup>
</Project>
CMakeLists.txt
...
if (MSVC_VERSION GREATER 1599 AND
NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/NSISTest_Preprocess.vcxproj.user")
file(TO_NATIVE_PATH "[your installer's path goes here]" _my_installer_path)
configure_file(
"VS2010Test-Debug.vcxproj.user.in"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/NSISTest_Preprocess.vcxproj.user"
)
file(
COPY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/NSISTest_Preprocess.vcxproj.user"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}"
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
endif()
Background
.user
files very wellReferences