鏈接到外部庫(kù)如何讓CMake將可執(zhí)行文件鏈接到不在同一個(gè)CMake項(xiàng)目中構(gòu)建的外部共享庫(kù)?只是在做target_link_libraries(GLBall ${CMAKE_BINARY_DIR}/res/mylib.so)給出誤差make[2]: *** No rule to make target `res/mylib.so', needed by `GLBall'. Stop.
make[1]: *** [CMakeFiles/GLBall.dir/all] Error 2
make: *** [all] Error 2
(GLBall is the executable)在我將庫(kù)復(fù)制到二進(jìn)制dir之后bin/res.我試著用find_library(RESULT mylib.so PATHS ${CMAKE_BINARY_DIR}/res)卻失敗了RESULT-NOTFOUND.
鏈接到外部庫(kù)
慕容3067478
2019-06-15 13:37:37