I was trying to get automoc to work with my Qt4.8 project in cmake-2.812,
and found out that the .h and the .cpp need to be in the same directory.

so this works:
       source/main.cpp
       source/MyWidget.cpp
       source/MyWidget.h

where MyWidget.h contains

class MyWidget : public QWidget {
       Q_OBJECT
public:
       MyWidget();
      ~MyWidget();
};

that is nicely
       Generating moc_MyWidget.cpp



But my project is actually organized as follows:
       source/main.cpp
       source/MyWidget.cpp
       include/MyWidget.h

and the automoc no longer works, since seems like it only scans the same
absolute path in
       Source / cmQtAutoGenerators.cxx :: findMatchingHeader()

is this by design? or am I missing some variable to make it also search in
my "include" directory.

I tried setting *CMAKE_AUTOMOC_MOC_OPTIONS* to
"-I${CMAKE_CURRENT_SOURCE_DIR}/../include" but that didn't help....

-- lode
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to