diff options
author | Christian Fetzer <fetzer.ch@gmail.com> | 2016-07-19 18:38:58 +0200 |
---|---|---|
committer | Christian Fetzer <fetzer.ch@gmail.com> | 2016-07-21 12:24:34 +0200 |
commit | 67d335a468fc64a7d405391c522957510481b770 (patch) | |
tree | 0dbaa03f96cb3d11c59aa37602722ff632e140c7 /project | |
parent | 66f8216277841ca8db4b2092bcfee88d39bb1ecf (diff) |
[cmake/win32] Set startup project and generate launcher for Visual Studio
Diffstat (limited to 'project')
-rw-r--r-- | project/cmake/CMakeLists.txt | 1 | ||||
-rw-r--r-- | project/cmake/scripts/windows/ArchSetup.cmake | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/project/cmake/CMakeLists.txt b/project/cmake/CMakeLists.txt index af71d7d4a3..e46a4f8492 100644 --- a/project/cmake/CMakeLists.txt +++ b/project/cmake/CMakeLists.txt @@ -315,6 +315,7 @@ unset(_MAIN_LIBRARIES) if(WIN32) set_target_properties(${APP_NAME_LC} PROPERTIES WIN32_EXECUTABLE ON) + set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME_LC}) copy_main_dlls_to_buildtree() elseif(CORE_SYSTEM_NAME STREQUAL android) # Nothing diff --git a/project/cmake/scripts/windows/ArchSetup.cmake b/project/cmake/scripts/windows/ArchSetup.cmake index f09e8b309e..1edbf3f742 100644 --- a/project/cmake/scripts/windows/ArchSetup.cmake +++ b/project/cmake/scripts/windows/ArchSetup.cmake @@ -80,4 +80,11 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OP if(CMAKE_GENERATOR MATCHES "Visual Studio") set_property(GLOBAL PROPERTY USE_FOLDERS ON) + + # Generate a batch file that opens Visual Studio with the necessary env variables set. + file(WRITE ${CMAKE_BINARY_DIR}/kodi-sln.bat + "@echo off\n" + "set KODI_HOME=%~dp0\n" + "set PATH=%~dp0\\system\n" + "start %~dp0\\${PROJECT_NAME}.sln") endif() |