[CMake] Finding Qt4 binaries under Windows

Sebastian Schuberth sschuberth at gmail.com
Fri Aug 21 14:31:31 EDT 2009


Hi,

I'm trying to use CMake for a Windows application that links against Qt 
4. I've installed Qt 4.5.1 from sources (unzipped to the standard 
location C:\Qt\4.5.1) and compiled it myself.

As qmake is not in my PATH, I'm using

---8<---(snip)---

cmake_minimum_required(VERSION 2.6.4)

set(name "Qt Test")
project(${name})

file(GLOB_RECURSE sources "src/*.h" "src/*.cpp" "src/*.ui")
add_executable(${name} ${sources})

include(FindQt4)
find_package(Qt4 PATHS "C:/Qt")

---8<---(snip)---

to point CMake to the right directory. It seems to work, sort of, but 
I'm getting the following error:

---8<---(snip)---

   Could not find a configuration file for package Qt4.

   Set Qt4_DIR to the directory containing a CMake configuration file 
for Qt4.
   The file will have one of the following names:

     Qt4Config.cmake
     qt4-config.cmake

---8<---(snip)---

Why is CMake searching for such a file? Where should that file be 
located? Do I need to create it?

-- 
Sebastian Schuberth



More information about the CMake mailing list