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 warning regarding gflags #116

Open
nickdesaulniers opened this issue Jul 1, 2021 · 2 comments
Open

cmake warning regarding gflags #116

nickdesaulniers opened this issue Jul 1, 2021 · 2 comments

Comments

@nickdesaulniers
Copy link
Member

$ cmake -G Ninja  -DCMAKE_INSTALL_PREFIX=. -DLLVM_PATH=/android0/llvm-project/llvm/build ..
...
CMake Warning at third_party/glog/CMakeLists.txt:63 (find_package):
  By not providing "Findgflags.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "gflags", but
  CMake did not find one.

  Could not find a package configuration file provided by "gflags" (requested
  version 2.2.0) with any of the following names:

    gflagsConfig.cmake
    gflags-config.cmake

  Add the installation prefix of "gflags" to CMAKE_PREFIX_PATH or set
  "gflags_DIR" to a directory containing one of the above files.  If "gflags"
  provides a separate development package or SDK, be sure it has been
  installed.
@nickdesaulniers
Copy link
Member Author

not sure if related, but cmake later fails with:

CMake Error at third_party/googletest/googletest/cmake/internal_utils.cmake:150 (add_library):
  add_library cannot create target "gtest" because an imported target with
  the same name already exists.
Call Stack (most recent call first):
  third_party/googletest/googletest/cmake/internal_utils.cmake:206 (cxx_library_with_type)
  third_party/googletest/googletest/CMakeLists.txt:128 (cxx_library)


CMake Error at third_party/googletest/googletest/cmake/internal_utils.cmake:150 (add_library):
  add_library cannot create target "gtest_main" because an imported target
  with the same name already exists.
Call Stack (most recent call first):
  third_party/googletest/googletest/cmake/internal_utils.cmake:206 (cxx_library_with_type)
  third_party/googletest/googletest/CMakeLists.txt:130 (cxx_library)


CMake Error at third_party/googletest/googletest/CMakeLists.txt:143 (target_link_libraries):
  Cannot specify link libraries for target "gtest_main" which is not built by
  this project.

@nickdesaulniers
Copy link
Member Author

I rebuilt LLVM itself with the additional cmake flags -DLLVM_INCLUDE_TESTS=OFF -DLLVM_ENABLE_RTTI=ON (that I don't typically use) based on this tip. I still saw the warning regarding gflags, but cmake did complete without the previously observed errors regarding gtest.

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