# set language std set(CMAKE_CXX_STANDARD 20) # set language std and disable fallback to a previous version set(CMAKE_CXX_STANDARD_REQUIRED ON) # Disable CXX Syntax EXTENSIONS set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(WebServer VERSION 0.1 DESCRIPTION "WebServer" LANGUAGES CXX )
# People keep running CMake in the wrong folder, completely nuking their project or creating weird bugs. # This checks if you're running CMake from a folder that already has CMakeLists.txt. # Importantly, this catches the common case of running it from the root directory. file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" PATH_TO_CMAKELISTS_TXT) if (EXISTS"${PATH_TO_CMAKELISTS_TXT}") message(FATAL_ERROR "Run CMake from a build subdirectory! \"mkdir build ; cd build ; cmake .. \" \ Some junk files were created in this folder (CMakeCache.txt, CMakeFiles); you should delete those.") endif ()
###################################################################################################################### # COMPILER END ######################################################################################################################