This document explains how to build and execute the Visual Studio environment with CMake. Currently, we recommend using VS2022
, but users can use VS2019
and VS2017
with minor modifications.
- Related files
- ./CmakeLists.txt
- Base file for CMake
- ./CMakeSettings.json
- Setting file for VS to use CMake
- Other CMakeLists.txt in subdirectories
- ./CmakeLists.txt
- Install Visual Studio 2022
- Select the following
Workloads
when installing the VS2022Desktop development with C++
- Select the following
- Clone s2e-core
- Please use
the latest release version
. - The following procedure possible does not work for
The latest develop branch
.
- Please use
- Check that the
ExtLibraries
directory is in the same directory as thes2e-core
like below.├─ExtLibraries └─s2e-core
- If not, please follow the procedure below to make
ExtLibraries
- Launch VS 2022
- Open the CMake file for the
ExtLibraries
- Click
Files/Open/CMake
. - Select the following
s2e-core/ExtLibraries/CMakeLists.txt
.└─s2e-core └─ExtLibraries └─CMakeLists.txt
- Wait a moment until the
CMake generation
is finished.
- Click
- Install the
ExtLibraries
- Select
CMakeLists.txt
by right-clicking in the VS'sSolution Explorer
. - Click the
Install
command. - Wait a moment until the installation is successfully finished.
- Select
- Check that the
ExtLibraries
directory is in the same directory as thes2e-core
- Check there are
cspice
andnrlmsise00
directories in theExtLibraries
like below.├─ExtLibraries │ └─cspice │ └─GeoPotential | └─nrlmsise00 └─s2e-core
- If not, please follow the procedure below to make
-
Launch VS 2022
-
Open the S2E project
- Click
File/Open/CMake
. - Select
s2e-core/CMakeLists.txt
at the top directory of the cloned S2E. - Wait a moment until the
CMake generation
is finished.
- Click
-
Build the S2E
- Select
CMakeLists.txt
by right-clicking in the VS'sSolution Explorer
. - Click the
Build
command. - Wait a moment until the build is successfully finished.
- Select
-
Check errors
- When users edit the codes, please check the error and fix them.
-
Run the program
-
Check log files
- Open the
./data/***/logs/logs_***
directory. - Open the CSV file to check the log output of the S2E.
- Open the
- For VS2019 users
- Please edit the compiler setting in
CMakeSetting.json
as"generator": "Visual Studio 16 2019".
- Please edit the compiler setting in
- For VS2017 users
- Please edit the compiler setting in
CMakeSetting.json
as"generator": "Visual Studio 15 2017".
- Users also need to edit the
cmake_minimum_required
version from 3.13 to 3.10 in all CMakeList, including the files in subdirectories. The VS 2017 does not support version 3.13, and you may see manywarnings
when you use CMake Version 3.10.
- Please edit the compiler setting in