From c3a6180a1ce6b94d093406457aedd9cec0cb1ceb Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Wed, 23 Oct 2024 12:42:44 -0400 Subject: [PATCH 1/2] chore: some CMake cleanup Signed-off-by: Henry Schreiner --- CMakeLists.txt | 2 -- .../source/developer_zone/dev_environment.rst | 2 +- .../installation/micromamba-installation.rst | 2 +- libmamba/CMakeLists.txt | 20 +++++++++---------- libmambapy/CMakeLists.txt | 10 +++------- 5 files changed, 15 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ff485336a..972f95df1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/docs/source/developer_zone/dev_environment.rst b/docs/source/developer_zone/dev_environment.rst index 59a4315320..371207e63d 100644 --- a/docs/source/developer_zone/dev_environment.rst +++ b/docs/source/developer_zone/dev_environment.rst @@ -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 **************************************** diff --git a/docs/source/installation/micromamba-installation.rst b/docs/source/installation/micromamba-installation.rst index 5019083921..64d4b9148c 100644 --- a/docs/source/installation/micromamba-installation.rst +++ b/docs/source/installation/micromamba-installation.rst @@ -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: diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index 67c6fb7849..41bd8b3e26 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -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 CONFIG REQUIRED) find_package(CURL CONFIG REQUIRED) find_library(LIBLZMA_LIBRARIES lzma REQUIRED) find_library(LZ4_LIBRARY NAMES lz4) diff --git a/libmambapy/CMakeLists.txt b/libmambapy/CMakeLists.txt index 5aadf84c40..e644962076 100644 --- a/libmambapy/CMakeLists.txt +++ b/libmambapy/CMakeLists.txt @@ -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 From 08461e76b4826890b484d06e7804cb34c0d5cfcb Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 25 Oct 2024 09:48:54 -0400 Subject: [PATCH 2/2] Update libmamba/CMakeLists.txt --- libmamba/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmamba/CMakeLists.txt b/libmamba/CMakeLists.txt index 41bd8b3e26..faf54a113e 100644 --- a/libmamba/CMakeLists.txt +++ b/libmamba/CMakeLists.txt @@ -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 CONFIG REQUIRED) + find_package(LibArchive MODULE REQUIRED) find_package(CURL CONFIG REQUIRED) find_library(LIBLZMA_LIBRARIES lzma REQUIRED) find_library(LZ4_LIBRARY NAMES lz4)