chore: some CMake cleanup (#3564)

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
This commit is contained in:
Henry Schreiner 2024-10-28 06:58:57 -04:00 committed by GitHub
parent 47e962968d
commit 5bfdd90adf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 15 additions and 21 deletions

View File

@ -5,8 +5,6 @@
# The full license is in the file LICENSE, distributed with this software.
cmake_minimum_required(VERSION 3.16)
cmake_policy(SET CMP0025 NEW) # Introduced in cmake 3.0
cmake_policy(SET CMP0077 NEW) # Introduced in cmake 3.13
project(mamba)

View File

@ -37,7 +37,7 @@ Install development dependencies
.. code:: bash
micromamba create -n mamba -c conda-forge -f dev/environment-dev.yml
micromamba activate -n mamba
micromamba activate mamba
Compile ``libmamba`` and other artifacts
****************************************

View File

@ -203,7 +203,7 @@ To build from source, install the development dependencies, using a Conda compat
.. code-block:: bash
micromamba create -n mamba --file dev/environment-micromamba-static.yml
micromamba activate -n mamba
micromamba activate mamba
Use CMake from this environment to drive the build:

View File

@ -405,15 +405,15 @@ set(
# Targets and link
# ================
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(tl-expected REQUIRED)
find_package(nlohmann_json REQUIRED)
find_package(simdjson REQUIRED)
find_package(yaml-cpp REQUIRED)
find_package(reproc REQUIRED)
find_package(reproc++ REQUIRED)
find_package(Libsolv REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(tl-expected CONFIG REQUIRED)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(simdjson CONFIG REQUIRED)
find_package(yaml-cpp CONFIG REQUIRED)
find_package(reproc CONFIG REQUIRED)
find_package(reproc++ CONFIG REQUIRED)
find_package(Libsolv MODULE REQUIRED)
add_subdirectory(ext/solv-cpp)
macro(libmamba_create_target target_name linkage output_name)
@ -539,7 +539,7 @@ macro(libmamba_create_target target_name linkage output_name)
set(CMAKE_PREFIX_PATH "$ENV{VCPKG_ROOT}/installed/x64-windows-static-md/")
# For Windows we have a vcpkg based build system right now.
find_package(LibArchive REQUIRED)
find_package(LibArchive MODULE REQUIRED)
find_package(CURL CONFIG REQUIRED)
find_library(LIBLZMA_LIBRARIES lzma REQUIRED)
find_library(LZ4_LIBRARY NAMES lz4)

View File

@ -7,20 +7,16 @@ cmake_minimum_required(VERSION 3.18.2)
include("../cmake/CompilerWarnings.cmake")
cmake_policy(SET CMP0025 NEW)
cmake_policy(SET CMP0077 NEW)
cmake_policy(SET CMP0057 NEW)
project(libmambapy)
if(NOT TARGET mamba::libmamba)
find_package(libmamba REQUIRED)
find_package(libmamba CONFIG REQUIRED)
set(libmamba_target mamba::libmamba-dyn)
else()
set(libmamba_target mamba::libmamba)
endif()
find_package(Python COMPONENTS Interpreter Development)
find_package(Python COMPONENTS Interpreter Development.Module)
find_package(pybind11 REQUIRED)
pybind11_add_module(
@ -49,7 +45,7 @@ target_compile_features(bindings PRIVATE cxx_std_17)
if(SKBUILD)
install(TARGETS bindings DESTINATION ${MAMBA_INSTALL_PYTHON_EXT_LIBDIR})
else()
# WARNING: this default should probably not be used as it is but set extranlly by a proper
# WARNING: this default should probably not be used as it is but set externally by a proper
# Python packager tool
set(
MAMBA_INSTALL_PYTHON_EXT_LIBDIR