Created
June 14, 2025 17:15
-
-
Save stevedoyle/44f860e3275fef261f050930b92fc668 to your computer and use it in GitHub Desktop.
Minimal CMakeLists.txt file with all source files in the same directory as the CMakeLists.txt file. #
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Minimal CMakeLists.txt file with all source files in the same directory as the CMakeLists.txt file. | |
# | |
cmake_minimum_required(VERSION 3.15) | |
project(MyProject) | |
set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}") | |
set(SOURCES "${SRC_DIR}/main.cpp" "${SRC_DIR}/file1.cpp" "${SRC_DIR}/file2.cpp") | |
add_executable(${PROJECT_NAME} ${SOURCES}) | |
set_target_properties(${PROJECT_NAME} PROPERTIES | |
CXX_STANDARD 20 | |
CXX_STANDARD_REQUIRED ON | |
CXX_EXTENSIONS OFF | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment