Created
May 7, 2021 16:01
-
-
Save wvovaw/64c01ef33ae5caa84392a2c8558737b9 to your computer and use it in GitHub Desktop.
CMakeLists.txt for C/C++ projects
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
cmake_minimum_required(VERSION 3.10) | |
set(PROJECT_NAME myProject) | |
project(${PROJECT_NAME} VERSION 1.0 LANGUAGES CXX) # OR C | |
set(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_BUILD_TYPE}) | |
file(GLOB_RECURSE SOURCE_FILES src/*) | |
file(GLOB_RECURSE SOURCE_HEADERS include/*) | |
set(SOURCES ${SOURCE_FILES} ${SOURCE_HEADERS}) | |
add_executable(${PROJECT_NAME} ${SOURCES}) | |
target_include_directories(${PROJECT_NAME} PRIVATE include/) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment