Skip to content

Commit 3307ff1

Browse files
authored
Add windows extra options (HDFGroup#4854)
1 parent 52d42fd commit 3307ff1

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

config/cmake/examples/HDF5_Examples.cmake.in

+8
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ if(DEFINED CTEST_SCRIPT_ARG)
4242
endforeach()
4343
endif()
4444

45+
if(${CTEST_VSVERS} STREQUAL "64_VS2022") # 64-bit Visual Studio 2022
46+
set(CTEST_CMAKE_GENERATOR "Visual Studio 17 2022")
47+
set(CMAKE_GENERATOR_ARCHITECTURE "x64")
48+
elseif(${VS_VERS} STREQUAL "64_VS2019") # 64-bit Visual Studio 2019
49+
set(CTEST_CMAKE_GENERATOR "Visual Studio 16 2019")
50+
set(CMAKE_GENERATOR_ARCHITECTURE "x64")
51+
endif()
52+
4553
###################################################################
4654
### Following Line is one of [Release, RelWithDebInfo, Debug] #####
4755
set(CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")

release_docs/USING_CMake_Examples.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ Default installation process:
5656
The default ctest configuration is defined as "Release". It can be changed
5757
with the CTEST_CONFIGURATION_TYPE script option. Note that this must
5858
be the same as the value used with the -C command line option.
59+
On Windows, you can set the CTEST_VSVERS script option to either
60+
64_VS2022 or 64_VS2019. Alternately, you can set the script
61+
CTEST_CMAKE_GENERATOR option to "Visual Studio 16 2019" or "Visual Studio 17 2022",
62+
and the CMAKE_GENERATOR_ARCHITECTURE script option to "x64".
63+
5964
The default build configuration is defined to build and use static libraries.
6065

6166
Shared libraries and other options can be changed by editing the
@@ -69,15 +74,15 @@ Default installation process:
6974
When executed, the ctest script will save the results to the log file, test.log, as
7075
indicated by the ctest command. If you wish to see more build and test information,
7176
add "-VV" to the ctest command. The output should show;
72-
100% tests passed, 0 tests failed out of 156.
77+
100% tests passed, 0 tests failed out of 206.
7378

7479

7580
========================================================================
7681
III. Defaults in the HDF5_Examples_options.cmake file
7782
========================================================================
7883

79-
#### DEFAULT: ###
80-
#### BUILD_SHARED_LIBS:BOOL=OFF ###
84+
#### DEFAULT: ###
85+
#### BUILD_SHARED_LIBS:BOOL=OFF ###
8186
#### H5EX_BUILD_C:BOOL=ON ###
8287
#### H5EX_BUILD_CXX:BOOL=OFF ###
8388
#### H5EX_BUILD_FORTRAN:BOOL=OFF ###

0 commit comments

Comments
 (0)