-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: some CMake cleanup #3564
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no |
||
|
||
Compile ``libmamba`` and other artifacts | ||
**************************************** | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
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) | ||
henryiii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
find_package(CURL CONFIG REQUIRED) | ||
find_library(LIBLZMA_LIBRARIES lzma REQUIRED) | ||
find_library(LZ4_LIBRARY NAMES lz4) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default |
||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the minimum version of CMake sets all policies to NEW that were introduced on or before that value. (Also true if you set a version range, like 3.16...3.30)