Skip to content

Revisit conda-specific cmake'isms? #484

@timsnyder

Description

@timsnyder

if (USING_CONDA)
message (STATUS "Using CONDA toolchain")
# if you don't do this, cmake won't pass the conda $PREFIX/include to
# the conda compiler and things get crazy
unset(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES)
unset(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES)
# This has to be done after sparta-config.cmake and before include directories because
# those variables are maintained as directory properties and will propagate to the subdirectories
# when we start doing include_directories. If we clear them after, the toplevel sources will
# build but the subdirs won't
#
# See also https://gitlab.kitware.com/cmake/cmake/issues/17966#note_408480
endif ()

Thought it was interesting that https://cmake.org/cmake/help/latest/variable/CMAKE_SYSTEM_PREFIX_PATH.html#variable:CMAKE_SYSTEM_PREFIX_PATH for version 3.29 says ENV{CONDA_PREFIX} will be included in CMAKE_SYSTEM_PREFIX_PATH when using a conda compiler.

I'm not sure which version of cmake added this support but it seems to be improved from the last time I looked. Flipping through the versions of the documentation, it looks like maybe version 3.18 added it? 3.18.0 was July 2020 and 3.18.5 was Feb 2021.

We might be able to remove the special conda stuff in the cmake files...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions