File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ cmake_minimum_required (VERSION 3.20 )
2+ project (MathExpressionsSolver LANGUAGES CXX )
3+
4+ # Cmake configuration
5+ add_compile_options ("/utf-8" )
6+
7+ # C++ standard settings
8+ set (CMAKE_CXX_STANDARD 20)
9+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
10+ set (CMAKE_CXX_EXTENSIONS OFF )
11+
12+ # Automatically add all .cpp
13+ file (GLOB_RECURSE SRC_FILES
14+ "src/*.cpp"
15+ "src/core/*.cpp"
16+ "src/logic/*.cpp"
17+ "src/util/*.cpp"
18+ )
19+
20+ # Add external fmt library source
21+ set (FMT_PATH "${CMAKE_SOURCE_DIR } /external/fmtlib/fmt_12.0.0" )
22+ set (FMT_SRC "${FMT_PATH} /src/fmt.cpp" )
23+
24+ # Add include directories
25+ include_directories (
26+ "${CMAKE_SOURCE_DIR } /src"
27+ "${FMT_PATH} "
28+ )
29+
30+ # Define executable target
31+ add_executable (MathExpressionsSolver
32+ ${SRC_FILES}
33+ ${FMT_SRC}
34+ )
35+
36+ # Output directory configuration
37+ set_target_properties (MathExpressionsSolver PROPERTIES
38+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR } /bin"
39+ )
Original file line number Diff line number Diff line change 11@ echo off
2+ :: ===============================
3+ :: build.bat - Build executable and run
4+ :: Author: DragonTaki
5+ :: ===============================
26cd /d %~dp0
37
48:: Set up VS compilation environment
Original file line number Diff line number Diff line change 1+ @ echo off
2+ :: ===============================
3+ :: build_exe.bat - Build executable only
4+ :: Author: DragonTaki
5+ :: ===============================
6+ cd /d %~dp0
7+
8+ :: Set up VS compilation environment
9+ call " C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
10+
11+ :: Create "build" folder
12+ if not exist build mkdir build
13+ cd build
14+
15+ :: Use CMake to generate VS2022 project
16+ echo [1/3] Configuring CMake project...
17+ cmake -G " NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..
18+
19+ if %errorlevel% neq 0 (
20+ echo [Error] CMake configuration failed.
21+ pause
22+ exit /b %errorlevel%
23+ )
24+
25+ :: Build project (Release mode)
26+ echo [2/3] Building project...
27+ cmake --build . --config Release
28+
29+ if %errorlevel% neq 0 (
30+ echo [Error] Build failed.
31+ pause
32+ exit /b %errorlevel%
33+ )
34+
35+ :: Show output result
36+ echo [3/3] Build completed successfully!
37+ echo Executable located at:
38+ echo %cd% \bin\MathExpressionsSolver.exe
39+ echo ========================================================
40+ pause
You can’t perform that action at this time.
0 commit comments