简体   繁体   English

在cmake中使用自定义编译器标志?

[英]using a custom compiler flag in cmake?

I'm trying to compile some code I found on GitHub https://github.com/tapio/Wendy I'm just trying to compile the stuff in tests/. 我正在尝试编译我在GitHub https://github.com/tapio/Wendy上找到的一些代码,我只是尝试在tests /中编译这些内容。 I never had any experience with cmake, but they're kinda logical anyway. 我从来没有任何关于cmake的经验,但是无论如何他们还是很合逻辑的。

I got stuck at the part where cmake does this: 我被卡马克做的那部分卡住了:

   /usr/bin/c++       CMakeFiles/clear.dir/clear.o  -o clear -rdynamic -lwendy -lglfw -lGLEW -lglm -lz 

and gets this error: 并得到此错误:

   Linking CXX executable clear
   /usr/bin/ld: cannot find -lwendy
   /usr/bin/ld: cannot find -lglm
   collect2: ld returned 1 exit status
   make[3]: *** [clear] Error 1
   make[2]: *** [CMakeFiles/clear.dir/all] Error 2
   make[1]: *** [CMakeFiles/clear.dir/rule] Error 2
   make: *** [clear] Error 2

I don't understand how the Wendy and glm folder became a compiler flag. 我不明白Wendy和glm文件夹如何成为编译器标志。 Somebody please explain how this is possible. 有人请解释这是怎么可能的。 :( :(

tests/CMakeLists.txt ,行target_link_libraries(${test} wendy ${WENDY_LIBRARIES})指示cmake将WENDY_LIBRARIES中的库列表链接到可执行文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM