Bonjour,
Voilà je me retrouve coincé sur un problème (j'ai bien l'impression que CMake et moi on va pas être copain >.<).
Le problème est qu'avec mon CMakeLists.txt suivant:
mon code source se compile très bien.
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) #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/* ) #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}) #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} )
Cependant uic et la commande de moc de Qt me créent des fichiers intempestifs.
J'ai des fichiers moc_*.cxx au même endroit que mes headers et des fichiers ui_*.h à la racine de mon dossier projet...
Ce que je souhaiterais faire c'est soit les retirer à la fin de la compilation de mon exécutable,
soit les déplacer dans un dossier à la racine de mon projet (dans un fichier build par exemple).
Car ceci + mercurial = désordre pas possible.
Je vous joins les fichiers de mon projet.
Merci d'avance.
Partager