cmake error:Targets not yet defined: gflags_shared
- Dominant language
- C++
- Stars
- 2.9k
- Forks
- 553
- PR merge metrics
- No merged PRs in 30d
Description
你好!我在cmake的时候遇到下面一个问题:
CMake Error at /home/deng/usr/local/gflags/lib/cmake/gflags/gflags-targets.cmake:35 (message):
Some (but not all) targets in this export set were already defined.
Targets Defined: gflags_nothreads_shared
Targets not yet defined: gflags_shared
print defined:
Call Stack (most recent call first):
/home/deng/usr/local/gflags/lib/cmake/gflags/gflags-config.cmake:10 (include)
third_party/glog/CMakeLists.txt:51 (find_package)
其中,print defined: 是我修改 gflags的message信息,我想打印_expectedTarget。
问题具体描述如下:
我下载的euler 源码版本是Euler 0.1.2,由于git clone --recursive 无法将所有的third-party下载完整,所有每个子模块我根据Euler 0.1.2版本分支下载,在我cmake 的时候遇到了上述问题,以下是我的cmake指令,我选择安装在用户目录下:
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS='-fPIC' -DCMAKE_INSTALL_PREFIX=$HOME/usr/local/euler ..
我单独make glog按照成功了,但不知道为什么我在cmake 整个工程的时候提示我出现了上述问题。我的环境配置应该没问题,因为我pip install euler 按照成功了,并成功按照给定模型进行训练。
请问该如何解决呢?谢谢!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with third_party/glog/CMakeLists.txt at the find_package call, then inspect the referenced gflags-config.cmake and gflags-targets.cmake files around the reported target definitions. Reproduce the failure using the stated CMake command and Euler 0.1.2 dependency layout. Done means the full project configures successfully without the gflags target error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100