Changes to better support Visual Studio

Signed-off-by: Matthew A Johnson <matjoh@microsoft.com>
This commit is contained in:
Matthew A Johnson 2023-01-11 11:39:05 +00:00
Родитель 43507f6ed6
Коммит 4c38a5cc18
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 236FC3E4E5A689D3
3 изменённых файлов: 66 добавлений и 1 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -280,4 +280,6 @@ examples/**/*.html
ci/downloads
test-output.xml
wheelhouse
python_examples/*.js
python_examples/*.js
.vs
TestResults

59
CMakePresets.json Normal file
Просмотреть файл

@ -0,0 +1,59 @@
{
"version": 3,
"configurePresets": [
{
"name": "windows-base",
"description": "Target Windows with the Visual Studio development environment.",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe",
"SCENEPIC_BUILD_TESTS": "1"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-debug",
"displayName": "x64 Debug",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (Debug)",
"inherits": "windows-base",
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
},
{
"name": "x64-release",
"displayName": "x64 Release",
"description": "Target Windows (64-bit) with the Visual Studio development environment. (RelWithDebInfo)",
"inherits": "x64-debug",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }
},
{
"name": "x86-debug",
"displayName": "x86 Debug",
"description": "Target Windows (32-bit) with the Visual Studio development environment. (Debug)",
"inherits": "windows-base",
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" }
},
{
"name": "x86-release",
"displayName": "x86 Release",
"description": "Target Windows (32-bit) with the Visual Studio development environment. (RelWithDebInfo)",
"inherits": "x86-debug",
"cacheVariables": { "CMAKE_BUILD_TYPE": "Release" }
}
]
}

Просмотреть файл

@ -45,6 +45,10 @@ if (TARGET scenepic_examples )
endif()
target_link_libraries( ${TEST_DRIVER} scenepic::scenepic )
if(WIN32)
target_link_options(${TEST_DRIVER} PRIVATE /Profile)
endif(WIN32)
target_compile_features(${TEST_DRIVER} PRIVATE cxx_std_14)
target_include_directories(${TEST_DRIVER} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src/scenepic/)