Skip to content

Instantly share code, notes, and snippets.

@sepfy
Last active August 18, 2020 07:11
Show Gist options
  • Save sepfy/d191938e167368d33f954989a8f59d2c to your computer and use it in GitHub Desktop.
Save sepfy/d191938e167368d33f954989a8f59d2c to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 3.1)
project(app)
file(GLOB APP_SOURCES "*.c")
foreach(sourcefile ${APP_SOURCES})
string(REPLACE ".c" "" appname ${sourcefile})
string(REPLACE "${PROJECT_SOURCE_DIR}/" "" appname ${appname})
add_executable(${appname} ${sourcefile})
endforeach(sourcefile ${APP_SOURCES})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment