1
0
Fork 0

Improve MSVC project generation

- set startup project to fgfs
- guess a value for PATH based on the build config
This commit is contained in:
James Turner 2018-06-16 13:03:23 +01:00
parent 7c9b1b391f
commit 82f23e556e
2 changed files with 19 additions and 0 deletions

View file

@ -584,6 +584,10 @@ add_subdirectory(man)
add_subdirectory(package) add_subdirectory(package)
add_subdirectory(scripts) add_subdirectory(scripts)
#----------------------------------------------------------------------------
### MSVC startup project - ensure you can just hit build & run in MSVC
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT fgfs)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
### uninstall target ### uninstall target
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

View file

@ -112,3 +112,18 @@ endif()
if (COMMAND flightgear_test) if (COMMAND flightgear_test)
flightgear_test(autosaveMigration test_autosaveMigration.cxx) flightgear_test(autosaveMigration test_autosaveMigration.cxx)
endif() endif()
if (MSVC)
if (TARGET Qt5::qmake)
# property is the full path to qmake.exe
get_target_property(_qt5_qmake_path Qt5::qmake LOCATION)
get_filename_component(_qt5_bin_dir ${_qt5_qmake_path} DIRECTORY)
file(TO_NATIVE_PATH "${_qt5_bin_dir}" _qt5_bin_dir_native)
endif()
file(TO_NATIVE_PATH "${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/bin" _msvc_3rdparty_bin_dir)
file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}" _install_bin_dir)
set_property(TARGET fgfs PROPERTY
VS_GLOBAL_LocalDebuggerEnvironment "PATH=${_install_bin_dir};${_msvc_3rdparty_bin_dir};${_qt5_bin_dir_native}")
endif()