Skip to content
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

Fix apple frameworks in CMake generators #6003

Merged
merged 31 commits into from Nov 4, 2019
Merged

Conversation

@danimtb
Copy link
Member

@danimtb danimtb commented Oct 30, 2019

Changelog: Feature: Provide CONAN_FRAMEWORKS and CONAN_FRAMEWORKS_FOUND for Apple frameworks in CMake generators and conan_find_apple_frameworks() macro helper in CMake generators.
Docs: conan-io/docs#1472

#TAGS: slow

  • Refer to the issue that supports this Pull Request: closes #5909
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

@danimtb danimtb self-assigned this Oct 30, 2019
@danimtb danimtb added this to the 1.20 milestone Oct 30, 2019
@danimtb danimtb closed this Oct 30, 2019
@danimtb danimtb reopened this Oct 30, 2019
Copy link
Contributor

@lasote lasote left a comment

I think it looks much better now. Fix the test of mac, should be changing the assert only. The messages for the framework are now much more explanatory.

@memsharded please review.

@@ -96,6 +106,11 @@ def cmake_dependencies(dependencies, build_type=""):
set(CONAN_SHARED_LINKER_FLAGS{build_type} "{deps.sharedlinkflags} ${{CONAN_SHARED_LINKER_FLAGS{build_type}}}")
set(CONAN_EXE_LINKER_FLAGS{build_type} "{deps.exelinkflags} ${{CONAN_EXE_LINKER_FLAGS{build_type}}}")
set(CONAN_C_FLAGS{build_type} "{deps.cflags} ${{CONAN_C_FLAGS{build_type}}}")
# Apple Frameworks
conan_find_apple_frameworks(CONAN_FRAMEWORKS{build_type} CONAN_FRAMEWORKS_FOUND{build_type})
Copy link
Contributor

@lasote lasote Oct 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would do this call earlier before the first CONAN_LIBS declaration. It is not easy to see that it has been aggregated. Is it possible?

Copy link
Member Author

@danimtb danimtb Oct 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The thing here is that you need CONAN_FRAMEWORKS defined before this call and then assign the values found to CONAN_LIBS. So first frameworks, then function call, and finally conan_libs.

However, many tests check the library values of CONAN_LIBS and didn't want to modify all the tests for this PR.

If you advise me to do it, I will do it without any problem.

conans/client/generators/cmake_common.py Show resolved Hide resolved
conans/client/generators/cmake_common.py Outdated Show resolved Hide resolved
conans/client/generators/cmake_common.py Outdated Show resolved Hide resolved
# Append to aggregated values variable
set(CONAN_LIBS_{dep}{build_type} ${{CONAN_PKG_LIBS_{dep}{build_type}}} ${{CONAN_SYSTEM_LIBS_{dep}{build_type}}} ${{CONAN_FRAMEWORKS_FOUND_{dep}{build_type}}})
# Aggregate package libs and frameworks for conan_package_library_targets()
set(CONAN_LIBS_FRAMEWORKS_{dep}{build_type} ${{CONAN_PKG_LIBS_{dep}{build_type}}} ${{CONAN_FRAMEWORKS_FOUND_{dep}{build_type}}})
Copy link
Member Author

@danimtb danimtb Nov 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have no model to differentiate packaged frameworks from system frameworks, we are considering frameworks part of the libs of the package in order to create the targets later

lasote
lasote approved these changes Nov 4, 2019
@lasote lasote merged commit c69c5bf into conan-io:develop Nov 4, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants