diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..378eac2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..61c4ab2 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "deps/cmake-library"] + path = deps/cmake-library + url = https://gitea.site.tesses.net/tesses50/cmake-library.git diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ec0adfc --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.10) +project(MyNewProgram VERSION 1.0 + DESCRIPTION "CHOOSE YOUR DESCRIPTION") +add_subdirectory(deps/cmake-library) +add_executable(${PROJECT_NAME} src/main.c) + +target_link_libraries(${PROJECT_NAME} PUBLIC MyNewLibrary) \ No newline at end of file diff --git a/README.md b/README.md index e69de29..3a26dd0 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,2 @@ +# cmake program template +## Please edit CMakeLists.txt \ No newline at end of file diff --git a/deps/cmake-library b/deps/cmake-library new file mode 160000 index 0000000..de1dc0d --- /dev/null +++ b/deps/cmake-library @@ -0,0 +1 @@ +Subproject commit de1dc0dfe6e9c03f483353df61809aaec6ed7639 diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..53ae38e --- /dev/null +++ b/src/main.c @@ -0,0 +1,10 @@ +#include +#include +int main(int argc,char** argv) +{ + int a=37; + int b=5; + int out = add(a,b); + printf("%i + %i = %i\n",a,b,out); + return 0; +} \ No newline at end of file