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

When using CMake and vcpkg, cannot create ALIAS target "Backward::Backward" #294

Open
midrare opened this issue Apr 10, 2023 · 0 comments
Open

Comments

@midrare
Copy link

midrare commented Apr 10, 2023

Description
When using CMake with vcpkg, adding backwards causes an error due to duplicating target. Platform is Windows 11. vcpkg is 2023-03-29-664f8bb619b752430368d0f30a8289b761f5caba. cmake is 3.26.3. backwards-cpp is dc8b8c76822dcbc8918f032171050ad90e11eb7f. Compiler is MSVC 2022.

Steps to reproduce

  1. In CMakeLists.txt, CPMAddPackage("gh:bombela/backward-cpp#dc8b8c7") or add_subdirectory(backwards-cpp)
  2. In command line, cmake .. -G "NMake Makefiles" -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=C:/opt/vcpkg/scripts/buildsystems/vcpkg.cmake
  3. Observe error
-- Running vcpkg install - done
-- CPM: adding package backward-cpp@ (dc8b8c7)
-- Could NOT find libdw (missing: LIBDW_LIBRARY LIBDW_INCLUDE_DIR)
-- Could NOT find libbfd (missing: LIBBFD_LIBRARY LIBBFD_INCLUDE_DIR LIBDL_LIBRARY LIBDL_INCLUDE_DIR)
-- Could NOT find libdwarf (missing: LIBDWARF_LIBRARY LIBDWARF_INCLUDE_DIR LIBELF_LIBRARY LIBELF_INCLUDE_DIR LIBDL_LIBRARY LIBDL_INCLUDE_DIR)
-- Found Backward: C:/Users/shodan/Projects/instiller-cpp/cmake-build/_deps/backward-cpp-src
CMake Error at C:/opt/vcpkg/scripts/buildsystems/vcpkg.cmake:632 (_add_library):
  _add_library cannot create ALIAS target "Backward::Backward" because
  another target with the same name already exists.
Call Stack (most recent call first):
  cmake-build/_deps/backward-cpp-src/CMakeLists.txt:93 (add_library)


-- Configuring incomplete, errors occurred!

From testing, this started with commit 490fd39. The last working commit was 90398ee.

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

No branches or pull requests

1 participant