-
Notifications
You must be signed in to change notification settings - Fork 21
/
cmake_build_script_windows-vs2022.bat
77 lines (57 loc) · 3.05 KB
/
cmake_build_script_windows-vs2022.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
@ECHO off
REM Run this script from the "X64 Native Tools Command Prompt for VS 2019 (or VS 2022)" so that all the compiler stuff is set up
REM INSTALL_DIR is the directory for installing the built package and examples (e.g. c:\myprograms\ga-aem)
set INSTALL_DIR=%LocalAppData%\GA-AEM
REM BUILD_DIR is a temporary directory for building (compiling and linking)
set BUILD_DIR=%cd%\build-windows-vs2022
REM Optionally delete the BUILD_DIR to ensure a clean cache/start
REM DEL /S /Q %BUILD_DIR%
REM Set the FFTW path if not set in user environment externally
SET FFTW_DIR=%LocalAppData%\fftw-3.3.5-dll64
REM Set the NetCDF path if not set in user environment externally
SET NETCDF_DIR=C:\Program Files\netCDF 4.9.2
REM Set the GDAL path if not set in user environment externally
SET GDAL_DIR=%LocalAppData%\gdal-3.7.1-mapserver-8-0-1
REM Set the PETSc paths if not set in user environment externally
SET PETSC_DIR=%LocalAppData%\petsc\3.9.4\vs2017
SET PETSC_INCLUDE_DIRS=%PETSC_DIR%\include;%PETSC_DIR%\win64_release\include
SET PETSC_LIBRARY_DIR=%PETSC_DIR%\win64_release\lib
SET PETSC_LIBRARIES=libf2cblas.lib;libf2clapack.lib;libpetsc.lib
SET PETSC_LINK_OPTIONS=
REM Create and cd to the BUILD_DIR
mkdir %BUILD_DIR%
cd %BUILD_DIR%
REM First generate the build cache first
REM cmake -G "Visual Studio 16 2019" -A x64 -Wno-dev -DCMAKE_CXX_COMPILER=msvc ..
cmake -G "Visual Studio 17 2022" -A x64 -Wno-dev -DCMAKE_CXX_COMPILER=msvc -DCMAKE_BUILD_TYPE=Release ..
REM Switches for turning off certain dependencies if they are not wanted or available
REM -DWITH_FFTW=OFF
REM -DWITH_MPI=OFF
REM -DWITH_NETCDF=OFF
REM -DWITH_GDAL=OFF
REM -DWITH_PETSC=OFF
REM cmake -G "Visual Studio 17 2022" -A x64 -Wno-dev -DCMAKE_CXX_COMPILER=msvc -DCMAKE_BUILD_TYPE=Release -DWITH_MPI=OFF -DWITH_NETCDF=OFF -DWITH_GDAL=OFF -DWITH_PETSC=OFF ..
REM Build and install everything
cmake --build . --config=Release
cmake --install . --prefix %INSTALL_DIR%
REM Or alternatively ...
REM Build only particular targets
REM cmake --build . --target galeisbstdem --config=Release
REM cmake --build . --target galeisbstdem-nompi --config=Release
REM cmake --build . --target garjmcmctdem --config=Release
REM cmake --build . --target galeiallatonce --config=Release
REM cmake --build . --target gaforwardmodeltdem --config=Release
REM cmake --build . --target example_forward_model --config=Release
REM cmake --build . --target example_forward_model_c --config=Release
REM cmake --build . --target gatdaem1d-static --config=Release
REM cmake --build . --target gatdaem1d-shared --config=Release
REM cmake --build . --target matlab-bindings --config=Release
REM cmake --build . --target python-bindings --config=Release
REM cmake --build . --target ctlinedata2sgrid --config=Release
REM cmake --build . --target ctlinedata2slicegrids --config=Release
REM cmake --build . --target ctlinedata2georefimage --config=Release
REM cmake --build . --target ctlinedata2curtainimage --config=Release
REM cmake --build . --target removelog10conductivityfromsgrid --config=Release
REM cmake --install . --prefix %INSTALL_DIR%
cd ..
PAUSE