即使有提示,CMake也找不到库

时间:2017-06-20 22:57:37

标签: makefile build cmake intl

我的构建失败并显示以下消息

ld: library not found for -lintl

根据我的理解,它在以下目录中讨论libintl.a

dir

我尝试在我的cmake文件中执行以下操作无效:

cmake_minimum_required(VERSION 3.8)
project(Visual)

file(GLOB SOURCES src/*.cpp)
file(GLOB HEADERS src/*.h)

add_executable(visual ${HEADERS} ${SOURCES})

find_package(PkgConfig REQUIRED)

[...]

# gettext
find_library(INTL
        NAMES intl libintl
        HINTS "/usr/local/opt/gettext/lib")
if (NOT INTL_FOUND)
    message(WARNING "Did not find intl")
endif ()

target_link_libraries(visual ${INTL})

target_link_libraries(visual ${LIBS})

0 个答案:

没有答案