File tree Expand file tree Collapse file tree 2 files changed +26
-16
lines changed Expand file tree Collapse file tree 2 files changed +26
-16
lines changed Original file line number Diff line number Diff line change @@ -66,21 +66,11 @@ set(NBL_BUILTIN_RESOURCES_DIRECTORY_PATH "${NBL_ROOT_PATH}/include/nbl/builtin")
66
66
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NBL_ROOT_PATH} /cmake" CACHE PATH "" )
67
67
get_property (NBL_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG )
68
68
69
+ include (common )
69
70
#import .vsconfig file with VS components required for Nabla
70
- if (WIN32 AND MSVC )
71
- option (NBL_IMPORT_VS_CONFIG "" ON )
72
-
73
- if (NBL_IMPORT_VS_CONFIG )
74
- message (STATUS "NOTICE: Configuration will continue after Visual Studio Installer is closed." )
75
- message (STATUS "To disable VS config import uncheck the NBL_IMPORT_VS_CONFIG option." )
76
- set (DEVENV_ISOLATION_INI_PATH "${CMAKE_GENERATOR_INSTANCE} /Common7/IDE/devenv.isolation.ini" )
77
- file (READ ${DEVENV_ISOLATION_INI_PATH} DEVENV_ISOLATION_INI_CONTENT )
78
- string (REGEX MATCH "SetupEngineFilePath=\" ([^\" ]*)\" " _match "${DEVENV_ISOLATION_INI_CONTENT} " )
79
- string (REPLACE "/" "\\ " NBL_VS_INSTALLATION_PATH ${CMAKE_GENERATOR_INSTANCE} )
80
- set (VS_INSTALLER_PATH "${CMAKE_MATCH_1} " )
81
-
82
- execute_process (COMMAND "${VS_INSTALLER_PATH} " modify --installPath "${NBL_VS_INSTALLATION_PATH} " --config "${NBL_ROOT_PATH} /.vsconfig" --allowUnsignedExtensions )
83
- endif ()
71
+ if (WIN32 AND "${CMAKE_GENERATOR} " MATCHES "Visual Studio" )
72
+ option (NBL_ENABLE_VS_CONFIG_IMPORT "" OFF )
73
+ NBL_IMPORT_VS_CONFIG ()
84
74
endif ()
85
75
86
76
# Configure CCache if available
@@ -206,7 +196,6 @@ get_filename_component(NBL_MEDIA_DIRECTORY_ABS "${NBL_MEDIA_DIRECTORY}" ABSOLUTE
206
196
207
197
include (submodules/update )
208
198
find_package (Python3 COMPONENTS Interpreter REQUIRED )
209
- include (common )
210
199
211
200
add_subdirectory (${THIRD_PARTY_SOURCE_DIR} )
212
201
Original file line number Diff line number Diff line change @@ -1298,4 +1298,25 @@ macro(NBL_GET_ALL_TARGETS_RECURSIVE NBL_TARGETS NBL_DIRECTORY)
1298
1298
1299
1299
get_property (NBL_GATHERED_TARGETS DIRECTORY ${NBL_DIRECTORY} PROPERTY BUILDSYSTEM_TARGETS )
1300
1300
list (APPEND ${NBL_TARGETS} ${NBL_GATHERED_TARGETS} )
1301
- endmacro ()
1301
+ endmacro ()
1302
+
1303
+ function (NBL_IMPORT_VS_CONFIG )
1304
+ if (NBL_ENABLE_VS_CONFIG_IMPORT )
1305
+ message (STATUS "NOTICE: Configuration will continue after Visual Studio Installer is closed." )
1306
+ message (STATUS "To disable VS config import disable the NBL_IMPORT_VS_CONFIG option." )
1307
+ set (NBL_DEVENV_ISOLATION_INI_PATH "${CMAKE_GENERATOR_INSTANCE} /Common7/IDE/devenv.isolation.ini" )
1308
+ file (READ ${NBL_DEVENV_ISOLATION_INI_PATH} NBL_DEVENV_ISOLATION_INI_CONTENT )
1309
+ string (REPLACE "/" "\\ " NBL_VS_INSTALLATION_PATH ${CMAKE_GENERATOR_INSTANCE} )
1310
+ string (REGEX MATCH "SetupEngineFilePath=\" ([^\" ]*)\" " _match "${NBL_DEVENV_ISOLATION_INI_CONTENT} " )
1311
+ set (NBL_VS_INSTALLER_PATH "${CMAKE_MATCH_1} " )
1312
+
1313
+ execute_process (COMMAND "${NBL_VS_INSTALLER_PATH} " modify --installPath "${NBL_VS_INSTALLATION_PATH} " --config "${NBL_ROOT_PATH} /.vsconfig" --allowUnsignedExtensions
1314
+ ERROR_VARIABLE vsconfig_error
1315
+ RESULT_VARIABLE vsconfig_result )
1316
+
1317
+ if (NOT vsconfig_result EQUAL 0 )
1318
+ message (FATAL_ERROR "Visual Studio Installer error: ${vsconfig_error} " )
1319
+ endif ()
1320
+
1321
+ endif ()
1322
+ endfunction ()
You can’t perform that action at this time.
0 commit comments