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

cmake: Fix CMake (v3.16) cannot create ALIAS target "Wpe::FDO" error #487

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

psaavedra
Copy link
Member

... because target "PkgConfig::WpeFDO" is imported but not globally visible in cmake/FindWpeFDO.cmake.

Notice that this issue is not reproducible in CMake v3.22.

CMake doc [1][2] says:

The scope of the definition of an IMPORTED target is the directory
where it was defined. It may be accessed and used from
subdirectories, but not from parent directories or sibling directories.
The scope is similar to the scope of a cmake variable.

It is also possible to define a GLOBAL IMPORTED target which is
accessible globally in the buildsystem.

[1] 3.16: https://cmake.org/cmake/help/v3.16/manual/cmake-buildsystem.7.html#imported-targets
[2] latest: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets

Note: Target branch is cog-0.14 since there is not longer CMake rules in the master branch.

... because target "PkgConfig::WpeFDO" is imported but not globally
visible in cmake/FindWpeFDO.cmake.

Notice that this issue is not reproducible in CMake v3.22.

CMake doc [1][2] says:

"The scope of the definition of an IMPORTED target is the directory
where it was defined. It may be accessed and used from
subdirectories, but not from parent directories or sibling directories.
The scope is similar to the scope of a cmake variable.

It is also possible to define a GLOBAL IMPORTED target which is
accessible globally in the buildsystem."

[1] 3.16: https://cmake.org/cmake/help/v3.16/manual/cmake-buildsystem.7.html#imported-targets
[2] latest: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets
@psaavedra
Copy link
Member Author

Error:

| CMake Error at cmake/FindWpeFDO.cmake:5 (add_library):
|   add_library cannot create ALIAS target "Wpe::FDO" because target
|   "PkgConfig::WpeFDO" is imported but not globally visible.
| Call Stack (most recent call first):
|   platform/wayland/CMakeLists.txt:28 (find_package)
| 
| 
| -- Found WpeFDO: WPEBackend-fdo-1.0;wpe-1.0;xkbcommon (found version "1.12.0")
| -- Checking for module 'wayland-egl'
| --   Found wayland-egl, version 18.1.0
| -- Checking for module 'wayland-cursor'
| --   Found wayland-cursor, version 1.18.0
| -- Checking for module 'epoxy'
| --   Found epoxy, version 1.5.4
| -- Checking for module 'libdrm>=2.4.71'
| --   Found libdrm, version 2.4.101
| -- Checking for module 'gbm>=13.0'
| --   Found gbm, version 20.0.2
| -- Checking for module 'libinput'
| --   Found libinput, version 1.15.2
| -- Checking for module 'libudev'
| --   Found libudev, version 243
| -- Checking for module 'wayland-server'
| --   Found wayland-server, version 1.18.0
| CMake Error at cmake/FindWpeFDO.cmake:5 (add_library):
|   add_library cannot create ALIAS target "Wpe::FDO" because target
|   "PkgConfig::WpeFDO" is imported but not globally visible.
| Call Stack (most recent call first):
|   platform/drm/CMakeLists.txt:9 (find_package)
| 
| 
| -- Configuring incomplete, errors occurred!

psaavedra added a commit to Igalia/meta-webkit that referenced this pull request Sep 6, 2022
…FDO" error

... because target "PkgConfig::WpeFDO" is imported but not globally
visible in cmake/FindWpeFDO.cmake.

Notice that this issue is not reproducible in CMake v3.22 (ej. Kirkstone).

CMake doc [1][2] says:

"The scope of the definition of an IMPORTED target is the directory
where it was defined. It may be accessed and used from
subdirectories, but not from parent directories or sibling directories.
The scope is similar to the scope of a cmake variable.

It is also possible to define a GLOBAL IMPORTED target which is
accessible globally in the buildsystem."

[1] 3.16: https://cmake.org/cmake/help/v3.16/manual/cmake-buildsystem.7.html#imported-targets
[2] latest: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets

Upstream-Status: Submitted [Igalia/cog#487]
@psaavedra
Copy link
Member Author

@aperezdc, I'm not sure how to proceed. The https://github.com/Igalia/cog/runs/8203858606?check_suite_focus=true blames against a changed not done in this patch.

psaavedra added a commit to Igalia/meta-webkit that referenced this pull request Sep 6, 2022
…FDO" error

... because target "PkgConfig::WpeFDO" is imported but not globally
visible in cmake/FindWpeFDO.cmake.

Notice that this issue is not reproducible in CMake v3.22 (ej. Kirkstone).

CMake doc [1][2] says:

"The scope of the definition of an IMPORTED target is the directory
where it was defined. It may be accessed and used from
subdirectories, but not from parent directories or sibling directories.
The scope is similar to the scope of a cmake variable.

It is also possible to define a GLOBAL IMPORTED target which is
accessible globally in the buildsystem."

[1] 3.16: https://cmake.org/cmake/help/v3.16/manual/cmake-buildsystem.7.html#imported-targets
[2] latest: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets

Upstream-Status: Submitted [Igalia/cog#487]
@aperezdc
Copy link
Member

aperezdc commented Sep 6, 2022

Good find, thanks @psaavedra! I'll merge this manually, the style checker is being silly.

@aperezdc aperezdc merged commit dbab9d0 into cog-0.14 Sep 6, 2022
@aperezdc aperezdc deleted the psaavedra/cog-0.14_fix_build_with_cmake_3_22 branch September 6, 2022 10:03
psaavedra added a commit to Igalia/meta-webkit that referenced this pull request Sep 6, 2022
…FDO" error

... because target "PkgConfig::WpeFDO" is imported but not globally
visible in cmake/FindWpeFDO.cmake.

Notice that this issue is not reproducible in CMake v3.22 (ej. Kirkstone).

CMake doc [1][2] says:

"The scope of the definition of an IMPORTED target is the directory
where it was defined. It may be accessed and used from
subdirectories, but not from parent directories or sibling directories.
The scope is similar to the scope of a cmake variable.

It is also possible to define a GLOBAL IMPORTED target which is
accessible globally in the buildsystem."

[1] 3.16: https://cmake.org/cmake/help/v3.16/manual/cmake-buildsystem.7.html#imported-targets
[2] latest: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets

Upstream-Status: Submitted [Igalia/cog#487]
psaavedra added a commit to Igalia/meta-webkit that referenced this pull request Sep 6, 2022
…FDO" error

... because target "PkgConfig::WpeFDO" is imported but not globally
visible in cmake/FindWpeFDO.cmake.

Notice that this issue is not reproducible in CMake v3.22 (ej. Kirkstone).

CMake doc [1][2] says:

"The scope of the definition of an IMPORTED target is the directory
where it was defined. It may be accessed and used from
subdirectories, but not from parent directories or sibling directories.
The scope is similar to the scope of a cmake variable.

It is also possible to define a GLOBAL IMPORTED target which is
accessible globally in the buildsystem."

[1] 3.16: https://cmake.org/cmake/help/v3.16/manual/cmake-buildsystem.7.html#imported-targets
[2] latest: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets

Upstream-Status: Submitted [Igalia/cog#487]
psaavedra added a commit to Igalia/meta-webkit that referenced this pull request Sep 6, 2022
…FDO" error

... because target "PkgConfig::WpeFDO" is imported but not globally
visible in cmake/FindWpeFDO.cmake.

Notice that this issue is not reproducible in CMake v3.22 (ej. Kirkstone).

CMake doc [1][2] says:

"The scope of the definition of an IMPORTED target is the directory
where it was defined. It may be accessed and used from
subdirectories, but not from parent directories or sibling directories.
The scope is similar to the scope of a cmake variable.

It is also possible to define a GLOBAL IMPORTED target which is
accessible globally in the buildsystem."

[1] 3.16: https://cmake.org/cmake/help/v3.16/manual/cmake-buildsystem.7.html#imported-targets
[2] latest: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets

Upstream-Status: Submitted [Igalia/cog#487]
psaavedra added a commit to Igalia/meta-webkit that referenced this pull request Sep 6, 2022
…FDO" error

... because target "PkgConfig::WpeFDO" is imported but not globally
visible in cmake/FindWpeFDO.cmake.

Notice that this issue is not reproducible in CMake v3.22 (ej. Kirkstone).

CMake doc [1][2] says:

"The scope of the definition of an IMPORTED target is the directory
where it was defined. It may be accessed and used from
subdirectories, but not from parent directories or sibling directories.
The scope is similar to the scope of a cmake variable.

It is also possible to define a GLOBAL IMPORTED target which is
accessible globally in the buildsystem."

[1] 3.16: https://cmake.org/cmake/help/v3.16/manual/cmake-buildsystem.7.html#imported-targets
[2] latest: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets

Upstream-Status: Submitted [Igalia/cog#487]
psaavedra added a commit to Igalia/meta-webkit that referenced this pull request Sep 7, 2022
…FDO" error

... because target "PkgConfig::WpeFDO" is imported but not globally
visible in cmake/FindWpeFDO.cmake.

Notice that this issue is not reproducible in CMake v3.22 (ej. Kirkstone).

CMake doc [1][2] says:

"The scope of the definition of an IMPORTED target is the directory
where it was defined. It may be accessed and used from
subdirectories, but not from parent directories or sibling directories.
The scope is similar to the scope of a cmake variable.

It is also possible to define a GLOBAL IMPORTED target which is
accessible globally in the buildsystem."

[1] 3.16: https://cmake.org/cmake/help/v3.16/manual/cmake-buildsystem.7.html#imported-targets
[2] latest: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#imported-targets

Upstream-Status: Submitted [Igalia/cog#487]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants