Thank you for your help Andreas. I have tried your approach. Please
see the attached logs. The moc files are now somehow not generated. I
might need to use qt4_wrap_cpp after all ?

Best Regards,
Laszlo Papp
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/colorgcc
-- Check for working C compiler: /usr/bin/colorgcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/colorgcc/bin/c++
-- Check for working CXX compiler: /usr/lib/colorgcc/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /usr/bin/qmake (found version "4.7.4")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lpapp/Projects/kde/test/build
/usr/bin/cmake -H/home/lpapp/Projects/kde/test -B/home/lpapp/Projects/kde/test/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/lpapp/Projects/kde/test/build/CMakeFiles /home/lpapp/Projects/kde/test/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/lpapp/Projects/kde/test/build'
make -f CMakeFiles/test.dir/build.make CMakeFiles/test.dir/depend
make[2]: Entering directory `/home/lpapp/Projects/kde/test/build'
cd /home/lpapp/Projects/kde/test/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/lpapp/Projects/kde/test /home/lpapp/Projects/kde/test /home/lpapp/Projects/kde/test/build /home/lpapp/Projects/kde/test/build /home/lpapp/Projects/kde/test/build/CMakeFiles/test.dir/DependInfo.cmake --color=
Dependee "/home/lpapp/Projects/kde/test/build/CMakeFiles/test.dir/DependInfo.cmake" is newer than depender "/home/lpapp/Projects/kde/test/build/CMakeFiles/test.dir/depend.internal".
Dependee "/home/lpapp/Projects/kde/test/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/lpapp/Projects/kde/test/build/CMakeFiles/test.dir/depend.internal".
Scanning dependencies of target test
make[2]: Leaving directory `/home/lpapp/Projects/kde/test/build'
make -f CMakeFiles/test.dir/build.make CMakeFiles/test.dir/build
make[2]: Entering directory `/home/lpapp/Projects/kde/test/build'
/usr/bin/cmake -E cmake_progress_report /home/lpapp/Projects/kde/test/build/CMakeFiles 1
[100%] Building CXX object CMakeFiles/test.dir/main.cpp.o
/usr/lib/colorgcc/bin/c++    -g -I/home/lpapp/Projects/kde/test -I/home/lpapp/Projects/kde/test/build    -o CMakeFiles/test.dir/main.cpp.o -c /home/lpapp/Projects/kde/test/main.cpp
/home/lpapp/Projects/kde/test/main.cpp:8:24: fatal error: moc_main.cpp: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/test.dir/main.cpp.o] Error 1
make[2]: Leaving directory `/home/lpapp/Projects/kde/test/build'
make[1]: *** [CMakeFiles/test.dir/all] Error 2
make[1]: Leaving directory `/home/lpapp/Projects/kde/test/build'
make: *** [all] Error 2
root /home/lpapp/Projects/kde/test/build #  cat ../CMakeLists.txt 
cmake_minimum_required(VERSION 2.8)

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})

find_package(Qt4)

set(test_SRCS
    main.cpp
)

qt4_automoc(${test_SRCS})

add_executable(test ${test_SRCS})

root /home/lpapp/Projects/kde/test/build #  cat ../main.cpp 
#include <QtCore/QObject>

class MyClass : public QObject
{
    Q_OBJECT
};

#include "moc_main.cpp"

int main( int argc, char** argv )
{
    return 0;
}

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/colorgcc
-- Check for working C compiler: /usr/bin/colorgcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/colorgcc/bin/c++
-- Check for working CXX compiler: /usr/lib/colorgcc/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11
-- Looking for Q_WS_X11 - found
-- Looking for Q_WS_WIN
-- Looking for Q_WS_WIN - not found.
-- Looking for Q_WS_QWS
-- Looking for Q_WS_QWS - not found.
-- Looking for Q_WS_MAC
-- Looking for Q_WS_MAC - not found.
-- Found Qt4: /usr/bin/qmake (found version "4.7.4")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/lpapp/Projects/kde/test/build
/usr/bin/cmake -H/home/lpapp/Projects/kde/test -B/home/lpapp/Projects/kde/test/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/lpapp/Projects/kde/test/build/CMakeFiles /home/lpapp/Projects/kde/test/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/lpapp/Projects/kde/test/build'
make -f CMakeFiles/test.dir/build.make CMakeFiles/test.dir/depend
make[2]: Entering directory `/home/lpapp/Projects/kde/test/build'
cd /home/lpapp/Projects/kde/test/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/lpapp/Projects/kde/test /home/lpapp/Projects/kde/test /home/lpapp/Projects/kde/test/build /home/lpapp/Projects/kde/test/build /home/lpapp/Projects/kde/test/build/CMakeFiles/test.dir/DependInfo.cmake --color=
Dependee "/home/lpapp/Projects/kde/test/build/CMakeFiles/test.dir/DependInfo.cmake" is newer than depender "/home/lpapp/Projects/kde/test/build/CMakeFiles/test.dir/depend.internal".
Dependee "/home/lpapp/Projects/kde/test/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/lpapp/Projects/kde/test/build/CMakeFiles/test.dir/depend.internal".
Scanning dependencies of target test
make[2]: Leaving directory `/home/lpapp/Projects/kde/test/build'
make -f CMakeFiles/test.dir/build.make CMakeFiles/test.dir/build
make[2]: Entering directory `/home/lpapp/Projects/kde/test/build'
/usr/bin/cmake -E cmake_progress_report /home/lpapp/Projects/kde/test/build/CMakeFiles 1
[100%] Building CXX object CMakeFiles/test.dir/main.cpp.o
/usr/lib/colorgcc/bin/c++    -g -I/home/lpapp/Projects/kde/test -I/home/lpapp/Projects/kde/test/build    -o CMakeFiles/test.dir/main.cpp.o -c /home/lpapp/Projects/kde/test/main.cpp
/home/lpapp/Projects/kde/test/main.cpp:8:24: fatal error: moc_main.cxx: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/test.dir/main.cpp.o] Error 1
make[2]: Leaving directory `/home/lpapp/Projects/kde/test/build'
make[1]: *** [CMakeFiles/test.dir/all] Error 2
make[1]: Leaving directory `/home/lpapp/Projects/kde/test/build'
make: *** [all] Error 2
root /home/lpapp/Projects/kde/test/build #  cat ../CMakeLists.txt 
cmake_minimum_required(VERSION 2.8)

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})

find_package(Qt4)

set(test_SRCS
    main.cpp
)

qt4_automoc(${test_SRCS})

add_executable(test ${test_SRCS})

root /home/lpapp/Projects/kde/test/build #  cat ../main.cpp 
#include <QtCore/QObject>

class MyClass : public QObject
{
    Q_OBJECT
};

#include "moc_main.cxx"

int main( int argc, char** argv )
{
    return 0;
}

--

Powered by www.kitware.com

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

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

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

Reply via email to