Created
June 14, 2025 17:15
-
-
Save stevedoyle/48e197504af9a9e69130e5a85773f296 to your computer and use it in GitHub Desktop.
Basic CMakeLists.txt file with a basic project directory.
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
# Basic CMakeLists.txt file with a basic project directory. | |
# project_dir | |
# | | |
# |-- include | |
# |-- src | |
# | |
cmake_minimum_required(VERSION 3.15) | |
project(MyProject) | |
set(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/src") | |
set(SOURCES "${SRC_DIR}/main.cpp" "${SRC_DIR}/file1.cpp" "${SRC_DIR}/file2.cpp") | |
add_executable(${PROJECT_NAME} ${SOURCES}) | |
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_LIST_DIR}/include") | |
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