Hi folks, I have the following directory structure: ./Application ./Application/GUI.ui ./Application/GUI.cpp ./Application/GUI.qrc ./Application/GUI.h ./test ./test/gui ./test/gui/main.cpp ./test/gui/CMakeLists.txt
and creating a build directory under ./test/gui which I run cmake as "cmake ..". There are two problems I am facing with; 1. When I run cmake it creates a directory; test/Application, which shouldn't create I suppose. 2. When I run make it gives an error and exits; $ make [ 14%] Generating ui_GUI.h File '/home/emre/tmp/cmake_qt/Application/GUI.h' is not valid make[2]: *** [ui_GUI.h] Error 1 make[1]: *** [CMakeFiles/test_im_gui.dir/all] Error 2 make: *** [all] Error 2 $ _ Here is my CMakeLists.txt file (which I copied from a tutorial found on the web): ===================================================================== CMAKE_MINIMUM_REQUIRED(VERSION 2.6) # Set project's name PROJECT(sample) # with SET() command you can change variables or define new ones # here we define SAMPLE_SRCS variable that contains a list of # all .cpp files # note that we don't need \ at the end of line SET(SAMPLE_SRCS main.cpp ../../Application/GUI.cpp ) # another list, this time it includes all header files that should be treated # with moc SET(SAMPLE_MOC_HDRS ../../Application/GUI.h ) # some .ui files SET(SAMPLE_UIS ../../Application/GUI.ui ) # and finally a resource file SET(SAMPLE_RCS ../../Application/GUI.qrc ) # enable warnings ADD_DEFINITIONS(-Wall) # this command finds Qt4 libraries and sets all required variables # note that it's Qt4, not QT4 or qt4 FIND_PACKAGE(Qt4 REQUIRED) # add some useful macros and variables # (QT_USE_FILE is a variable defined by FIND_PACKAGE(Qt4) that contains a path # to CMake script) INCLUDE (${QT_USE_FILE}) # this command will generate rules that will run rcc on all files from # SAMPLE_RCS in result SAMPLE_RC_SRCS variable will contain paths # to files produced by rcc QT4_ADD_RESOURCES(SAMPLE_RC_SRCS ${SAMPLE_RCS}) # this will run uic on .ui files QT4_WRAP_UI(SAMPLE_UI_HDRS ${SAMPLE_MOC_HDRS}) # and finally this will run moc QT4_WRAP_CPP(SAMPLE_MOC_SRCS ${SAMPLE_MOC_HDRS}) # we need this to be able to include headers produced by uic in our code # (CMAKE_BINARY_DIR holds a path to the build directory, while # INCLUDE_DIRECTORIES() wordks just like INCLUDEPATH from qmake) INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ) # here we instruct CMake to build "sample" executable from all of the # source files ADD_EXECUTABLE(sample ${SAMPLE_SRCS} ${SAMPLE_MOC_SRCS} ${SAMPLE_RC_SRCS} ${SAMPLE_UI_HDRS}) # last thing we have to do is to tell CMake what libraries our executable needs, # luckily FIND_PACKAGE prepared QT_LIBRARIES variable for us TARGET_LINK_LIBRARIES(sample ${QT_LIBRARIES}) ===================================================================== Platform information: OS: Ubuntu 8.10 cmake version 2.6-patch 0 I'm also attaching a test case to create the problem. What am I doing wrong and how can I make it compile? Any help is appreciated. Thanks, emre
cmake_qt.tar.gz
Description: GNU Zip compressed data
_______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake