From a159f1a1b48c54171ae79e02e81ee25068d2a7d1 Mon Sep 17 00:00:00 2001 From: laentropia Date: Tue, 12 May 2026 09:07:44 -0600 Subject: [PATCH] initial commit --- .gitignore | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ src/main.c | 6 +++++ 3 files changed, 124 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 src/main.c diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ad1274f --- /dev/null +++ b/.gitignore @@ -0,0 +1,60 @@ +# Directories +build/ +build-*/ +cmake-build-*/ +.cache/ +out/ +out/Debug/ +out/Release/ + +# Cmake files +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +CTestTestfile.cmake +Testing/ +compile_commands.json +../compile_commands.json +build/compile_commands.json +cmake + +# Make / Ninja +Makefile +*.ninja +*.ninja_deps +*.ninja_log +rules.ninja + +# Object files +*.o +*.obj +*.lo +*.la + +# Binaries +*.out +*.exe +*.dll +*.so +*.so.* +*.dylib +*.a + +# Debug / Sanitizer +*.dSYM/ +*.gcno +*.gcda +*.gcov + +# Editors +.vscode/ +.idea/ +*.swp +*.swo +*~ + +# Git +COMMIT_MESSAGE + +docs +docs/images diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ccad39d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,58 @@ +cmake_minimum_required(VERSION 3.20) +project(binarysearch VERSION 1.0 LANGUAGES C) + +set(CMAKE_C_STANDARD 11) +set(CMAKE_C_STANDARD_REQUIRED ON) + +# clangd +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + + +# -------------------------------------------------- +# CPM.cmake bootstrap +# -------------------------------------------------- + +set(CPM_DOWNLOAD_VERSION 0.40.2) + +set(CPM_DOWNLOAD_LOCATION + "${CMAKE_BINARY_DIR}/cmake/CPM.cmake" +) + +if(NOT EXISTS ${CPM_DOWNLOAD_LOCATION}) + + message(STATUS "Downloading CPM.cmake...") + + file( + DOWNLOAD + "https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake" + "${CPM_DOWNLOAD_LOCATION}" + STATUS download_status + ) + + list(GET download_status 0 status_code) + + if(NOT status_code EQUAL 0) + message(FATAL_ERROR + "Failed to download CPM.cmake" + ) + endif() + +endif() + +include("${CPM_DOWNLOAD_LOCATION}") + +CPMAddPackage( + NAME arraylist + GIT_REPOSITORY https://laentropia-homelab.tail7368da.ts.net/laentropia/ArrayList.git + GIT_TAG main +) + + +# ------------------------ +# Example (opcional) +# ------------------------ +add_executable(binarysearch src/main.c) + +target_link_libraries(binarysearch + PUBLIC arraylist +) diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..ee26d0a --- /dev/null +++ b/src/main.c @@ -0,0 +1,6 @@ +#include +#include + +int main(void) { + return EXIT_SUCCESS; +}