求助!!
我在github上找到了一个大型的应用软件的开源代码,使用CMAKE编译,再用VS 2017以生成应用程序。
因为想改代码,所以使用了CLion在本地运行。
但是cmake能够正常通过的文件代码,clion却出错。
用的同一个cmakelists.txt,请问为什么clion出错和cmake正常呢?
求求~
改动了很久cmakelists.txt,
但是还是不行哦,卡在这个报错上:
——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
“
CMake Warning (dev) at CMakeLists.txt:33 (find_package):
Policy CMP0074 is not set: find_package uses
Run "cmake --help-policy CMP0074" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
Environment variable Qt5_ROOT is set to:
C:\Qt\Qt5.14.2
For compatibility, CMake is ignoring the variable.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at CMakeLists.txt:35 (target_link_libraries):
Cannot specify link libraries for target "FEBioStudio2" which is not built
by this project.
”
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
这是CMakeLists.txt的原文:
“
if(NOT Qt_Root)
# (查找 Qt 库的代码)
set(Qt_Root "C:/Qt/Qt5.14.2")
# 自己添加的这段代码:
find_package(Qt5 COMPONENTS Core Widgets OpenGL Gui)
target_link_libraries(FEBioStudio2 Qt5::Core)
target_link_libraries(CUILib Qt5::Widgets)
target_link_libraries(FSCore Qt5::Core)
target_link_libraries(GLLib Qt5::OpenGL)
target_link_libraries(GLWLib Qt5::Gui)
target_link_libraries(ImageLib Qt5::Core)
target_link_libraries(MeshIO Qt5::Core)
target_link_libraries(MeshTools Qt5::Core)
target_link_libraries(PostGL Qt5::Gui)
# 自己添加的代码 结束
endif()
”
这个还是解决不了。呜呜,求求大家帮助
标签:Qt5,cmake,target,libraries,link,出错,txt,clion From: https://www.cnblogs.com/princessgzdx/p/18283030