Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Why can't cmake find Qt5LinguistTools?

Why can't cmake find Qt5LinguistTools?

Scheduled Pinned Locked Moved Installation and Deployment
1 Posts 1 Posters 10.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    cscooper
    wrote on last edited by
    #1

    I'm in the process of ramping up on Qt5 (previously we used Qt4) and I'm encountering a strange problem. My project is based on CMakeLists.txt (not a PRO file) and I had that working fine until I tried to add in translation capability.

    I added these lines to my CMakeLists.txt:
    @ file (GLOB tsFiles translations/*.ts )
    qt5_add_translation(qmFiles ${tsFiles})@

    but it told me "Unknown CMake command qt5_add_translation" which I read on the Internet meant I needed to add:
    @find_package(Qt5LinguistTools REQUIRED)@

    which I did, but now it gives me this:

    CMake Error at CMakeLists.txt:25 (find_package):
    By not providing "FindQt5LinguistTools.cmake" in CMAKE_MODULE_PATH this
    project has asked CMake to find a package configuration file provided by
    "Qt5LinguistTools", but CMake did not find one.
    Could not find a package configuration file provided by "Qt5LinguistTools"
    with any of the following names:
    Qt5LinguistToolsConfig.cmake
    qt5linguisttools-config.cmake

    This is on OSX 10.8.5 where I have Qt5 installed in ~/Qt/5.2.0. The file clang_64/lib/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake definitely exists, and seems to be exactly parallel to clang_64/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake which it isn't having any problem finding.

    So why can cmake find Qt5Widgets but not Qt5LinguistTools?

    Thanks,
    Chris

    p.s. Here's my entire CMakeLists.txt:
    @CMAKE_MINIMUM_REQUIRED( VERSION 2.8.9 FATAL_ERROR )
    PROJECT(Project)
    set(CMAKE_AUTOMOC TRUE)
    set(CMAKE_INCLUDE_CURRENT_DIR ON)
    find_package(Qt5Core REQUIRED)
    find_package(Qt5Widgets REQUIRED)
    find_package(Qt5LinguistTools REQUIRED)
    file (GLOB_RECURSE cppFiles src/.cpp )
    file (GLOB_RECURSE hFiles include/
    .h )
    file (GLOB uiFiles src/ui/.ui )
    file (GLOB tsFiles translations/
    .ts )
    qt5_wrap_ui(uihfiles ${uiFiles})
    add_executable(Project ${cppFiles} ${hFiles} ${uiFiles})
    qt5_use_modules(Project Widgets)
    qt5_add_translation(qmFiles ${tsFiles})
    include_directories(include)@

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved