Bonjour à tous,
Alors voilà j'essaye actuellement de compiler un de mes projets Qt avec l'utilitaire CMake mais j'ai quelques soucis.
Avec le CMakeLists.txt suivant:
Me renvoie comme code d'erreur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103 cmake_minimum_required(VERSION 2.6) #Project configuration project(MyProject) FIND_PACKAGE(Qt4 REQUIRED) set(EXECUTABLE_OUTPUT_PATH bin/${CMAKE_BUILD_TYPE}) #Add QT headers INCLUDE(${QT_USE_FILE}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) # Search and include Qt4 parameters # Set Qt min required version and add modules here IF(WIN32) # FindQt4.cmake is so brain-dead when Xcompiling SET(QT_LIBRARY_DIR ${CONTRIBS_PATH}/lib) SET(QT_INCLUDE_DIR ${CONTRIBS_PATH}/include/qt4) ADD_DEFINITIONS( -I${CONTRIBS_PATH}/include/qt4/QtCore) ADD_DEFINITIONS( -I${CONTRIBS_PATH}/include/qt4/QtGui) ADD_DEFINITIONS( -I${CONTRIBS_PATH}/include/qt4/QtXml) ADD_DEFINITIONS( -I${CONTRIBS_PATH}/include/qt4/QtNetwork) ADD_DEFINITIONS( -I${CONTRIBS_PATH}/include/qt4/) FIND_PACKAGE(Qt4 4.7.4 COMPONENTS QtCore QtGui QtXml QtSvg QtNetwork REQUIRED ) ELSE(WIN32) FIND_PACKAGE(Qt4 4.7.4 COMPONENTS QtCore QtGui QtXml QtSvg QtNetwork REQUIRED ) ENDIF(WIN32) IF (NOT WIN32) #FindQt4.cmake is so brain-dead when Xcompiling SET(CMAKEQT_LIBS ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTSVG_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY}) # Add here any other QT module or other library INCLUDE(${QT_USE_FILE}) ADD_DEFINITIONS(${QT_DEFINITIONS}) ELSE (NOT WIN32) SET (CMAKEQT_LIBS -L${CONTRIBS_PATH}/lib # Manually specify paths ${CONTRIBS_PATH}/lib/libQtNetwork.a ${CONTRIBS_PATH}/lib/libQtXml.a ${CONTRIBS_PATH}/lib/libQtGui.a ${CONTRIBS_PATH}/lib/libQtCore.a ws2_32 winmm imm32 libeay32 ssleay32 crypt32 gdi32) ENDIF(NOT WIN32) #Transform QT files (moc, headers...) QT4_WRAP_CPP(app_headers_moc ${header_files}) QT4_WRAP_UI(app_ui_headers ${ui_forms}) QT4_ADD_RESOURCES(app_resources_rcc ${app_resources}) #Boost includes include(FindBoost) link_directories(${Boost_LIBRARY_DIRS}) include_directories(${Boost_INCLUDE_DIRS}) find_package( Boost 1.48.0 REQUIRED signals ) message( STATUS ${Boost_LIBRARIES} ) #App sources definition ------------------------------------------------------------- file( GLOB_RECURSE source_files src/cpp/* ) file( GLOB_RECURSE header_files src/header/* ) file( GLOB_RECURSE ui_forms src/ui/* ) file( GLOB_RECURSE app_resources src/resource/* ) #App compilation definition ------------------------------------------------------------- add_executable( ResAvionApp ${source_files} ${app_headers_moc} ${app_ui_headers} ${app_resources_rcc} ) #Linker configuration target_link_libraries( ResAvionApp ${Boost_LIBRARIES} ${QT_LIBRARIES} )
J'ai pourtant bien mis:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 [ 50%] Building CXX object CMakeFiles/ResAvionApp.dir/src/cpp/Main.cpp.o [100%] Building CXX object CMakeFiles/ResAvionApp.dir/src/cpp/Mainwindow.cpp.o /home/e-kami/workspace/Exos_et_pti_B2IG/ResAvion_Client_App/src/cpp/Mainwindow.cpp:2:33: erreur fatale: ../ui/ui_Mainwindow.h : Aucun fichier ou dossier de ce type compilation terminée. make[2]: *** [CMakeFiles/ResAvionApp.dir/src/cpp/Mainwindow.cpp.o] Erreur 1 make[1]: *** [CMakeFiles/ResAvionApp.dir/all] Erreur 2 make: *** [all] Erreur 2
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
et
QT4_WRAP_UI(app_ui_headers ${ui_forms})
mais pas moyen de compiler .
Je vous mets mon code source en pièce jointe.
Merci d'avance.
Partager