I am creating a CMake file for compiling a simple hello world program that uses QtCore. I use CMake to generate a VS 2012 project and it compiles fine. But when I execute it, it gives an error that says that Qt5Core.dll is missing.
I can fix this copying the .dll manually into the executable’s directory, but I don’t like this solution. Here is my CMake file:
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set (CMAKE_PREFIX_PATH "C:\\qt_src\\qt5-2010\\qtbase\\")
FIND_PACKAGE(Qt5Core REQUIRED)
SET(SOURCE
main.cpp
)
add_executable(toview ${SOURCE})
qt5_use_modules(toview Core)
Am I missing something? Is there a better way to do this? Thanks in advance!
↧