Files
sem2BinSearch/CMakeLists.txt

59 lines
1.2 KiB
CMake
Raw Permalink Normal View History

2026-05-12 09:07:44 -06:00
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
)