GithubHelp home page GithubHelp logo

Comments (9)

whitslack avatar whitslack commented on July 17, 2024 1

OpenEXR is relying on the OLD behavior of CMake policy CMP0107, which is deprecated by definition. Homebrew inadvertently switches CMP0107 to the NEW behavior, which breaks OpenEXR, by calling cmake_minimum_required(VERSION 3.24) in ${HOMEBREW_LIBRARY}/Homebrew/cmake/trap_fetchcontent_provider.cmake.

You can restore the OLD behavior (and suppress the error) by adding the following line to OpenEXR's CMakeLists.txt:

cmake_policy(SET CMP0107 OLD)

However, realize that OpenEXR's CMakeLists.txt is apparently expecting CMake to behave in a way that it does not (and apparently never has). Calling add_library() multiple times with the same <name> but different ALIAS <target>s does not accumulate those targets under the aliased name but rather either silently overwrites(!) the alias (the OLD behavior) or raises an error (the NEW behavior).

I started a discussion of the problem at Homebrew.

from openexr.

lgritz avatar lgritz commented on July 17, 2024

There is this message from OpenEXR's build in your log:

CMake Error at cmake/CMakeLists.txt:159 (add_library):
add_library cannot create ALIAS target "OpenEXR::Config" because another
target with the same name already exists.

It's hard to tell what's going wrong here, I don't believe this is a problem we've encountered before. It is likely specific to building on your old OS and toolchain, which homebrew itself says are no longer supported:

Error: You are using macOS 11.
We (and Apple) do not provide support for this old version.
It is expected behaviour that some formulae will fail to build in this old version.

These are messages from Homebrew itself. The OpenEXR project team does not maintain Homebrew itself, nor even the Homebrew recipe for building OpenEXR.

I doubt that any of us have a way to reproduce the problem given that we don't have any OS installs that old that we can run CI on.

from openexr.

uiryuu avatar uiryuu commented on July 17, 2024

Recently I tried to compile OpenEXR on macOS 10.15 using Homebrew as well, and I encountered the exact same problem ("add_library cannot create ALIAS target"). Then I suspect it was due to the old version of my system. I tried compile it using my macOS 14 machine using brew reinstall openexr --build-from-source, this problem still happened. Hopefully this will help.

from openexr.

AzraelWarrior avatar AzraelWarrior commented on July 17, 2024

Recently I tried to compile OpenEXR on macOS 10.15 using Homebrew as well, and I encountered the exact same problem ("add_library cannot create ALIAS target"). Then I suspect it was due to the old version of my system. I tried compile it using my macOS 14 machine using brew reinstall openexr --build-from-source, this problem still happened. Hopefully this will help.

This issue might be related to Homebrew, not OpenEXR. You can use the command brew --version to check the version of Homebrew installed on your system. If you have the latest version, you can try downgrading Homebrew to version 4.2.18 before proceeding with the compilation and installation of OpenEXR.

from openexr.

uiryuu avatar uiryuu commented on July 17, 2024

Tested with the latest homebrew, confirmed that the problem no longer exists. This issue could be closed.

from openexr.

BurkeyLai avatar BurkeyLai commented on July 17, 2024

Tested with the latest homebrew, confirmed that the problem no longer exists. This issue could be closed.

Hi, may I ask the latest homebrew version you used? Mine is 4.3.3. Also my OS version is Big Sur 11.7.10. Still same error showed. Thanks!

from openexr.

uiryuu avatar uiryuu commented on July 17, 2024

Hi, may I ask the latest homebrew version you used? Mine is 4.3.3. Also my OS version is Big Sur 11.7.10. Still same error showed. Thanks!

I'm also using 4.3.3 on macOS 14.5. Did you run something like brew upgrade to pull the latest commits which contain the fix for this?

from openexr.

BurkeyLai avatar BurkeyLai commented on July 17, 2024

I'm also using 4.3.3 on macOS 14.5. Did you run something like brew upgrade to pull the latest commits which contain the fix for this?

Sure, I use brew cleanup, brew update, brew upgrade to update. There is no any error. Once use brew install openexr to install, error show up:

Last 15 lines from /Users/bur/Library/Logs/Homebrew/openexr/01.cmake:
  target with the same name already exists.


CMake Error at cmake/CMakeLists.txt:170 (add_library):
  add_library cannot create ALIAS target "OpenEXR::Config" because another
  target with the same name already exists.

from openexr.

BurkeyLai avatar BurkeyLai commented on July 17, 2024

Sure, I use brew cleanup, brew update, brew upgrade to update. There is no any error. Once use brew install openexr to install, error show up:

Last 15 lines from /Users/bur/Library/Logs/Homebrew/openexr/01.cmake:
  target with the same name already exists.


CMake Error at cmake/CMakeLists.txt:170 (add_library):
  add_library cannot create ALIAS target "OpenEXR::Config" because another
  target with the same name already exists.

Solve this problem by checkout previous commit of Homebrew.

from openexr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.