Why can't cmake find Qt5LinguistTools?
-
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.cmakeThis 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,
Chrisp.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)@