initial commit
This commit is contained in:
60
.gitignore
vendored
Normal file
60
.gitignore
vendored
Normal file
@@ -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
|
||||||
58
CMakeLists.txt
Normal file
58
CMakeLists.txt
Normal file
@@ -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
|
||||||
|
)
|
||||||
6
src/main.c
Normal file
6
src/main.c
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user