cmake_minimum_required(VERSION 3.15) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++11 -W") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=c++11 -W") # project(sw) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/build) set(CMAKE_CXX_STANDARD 11) add_compile_options(-fPIC -g -Wall -Wshadow -Wno-sign-compare -w) file(GLOB_RECURSE current_headers ./src/*.h ) file(GLOB sources ./*.cpp ./src/*.cpp) source_group("Include" FILES ${current_headers}) source_group("Source" FILES ${sources}) add_executable(${PROJECT_NAME} main.cpp ${sources}) target_link_libraries(${PROJECT_NAME} )