Bonjour à tous,
Pour un petit framework personnel j'essaie d'utiliser CMake pour la génération des fichiers projets/makefiles.
Si je compile avec les projets, je n'ai aucune erreur de compilation, mais les bibliothèques n'ont pas le bon nom ni ne se trouvent au bon endroit: elles devraient se trouver dans un dossier lib mais se trouvent en réalité, dans lib/Debug ou lib/MinSizeRelease selon le mode de compilation choisi.
Alors j'utilise plutôt un makefile NMake. Mais là c'est le drame. J'ai l'erreur suivante:
Code x : 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 Microsoft (R) Program Maintenance Utility Version 9.00.21022.08 Copyright (C) Microsoft Corporation. Tous droits réservés. Linking CXX shared library C:\Users\Moi\Documents\Projects\Moi\C++\kTEngin e\API\lib\ktCore.dll LINK : fatal error LNK1146: aucun argument spÚcifiÚ avec l'option '/machine:' LINK failed. with 1146 NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake 2.8\bin\cmake.exe"' : code retour '0xffffffff' Stop. NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\ VC\BIN\nmake.exe"' : code retour '0x2' Stop. NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 9.0\ VC\BIN\nmake.exe"' : code retour '0x2' Stop.
Comment est-ce que je pourrais régler ce problème là?
Voici une partie de mon fichier CMake:
Merci à vous pour votre aimable aide .
Code cmake : 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 # Project name definition # -------------------------------------------- project( "kT Engine" ) # -------------------------------------------- # Allow the developer to select if Dynamic or Static libraries are built # -------------------------------------------- option( BUILD_SHARED_LIBS "Build kT Engine as Shared Libraries" ON ) if( BUILD_SHARED_LIBS ) # User wants to build Dynamic Libraries, so change the LIB_TYPE variable to CMake keyword 'SHARED' set( kt_lib_type SHARED ) add_definitions( -DKT_BUILDING_LIBRARY -DKT_DYNAMIC ) endif( BUILD_SHARED_LIBS ) # -------------------------------------------- # -------------------------------------------- # Set the output path # -------------------------------------------- set( LIBRARY_OUTPUT_PATH ../lib/ ) # -------------------------------------------- # Add -d to debug builds # -------------------------------------------- if( CMAKE_BUILD_TYPE STREQUAL "Debug" ) set( kt_lib_suffix "-d" ) else() set( kt_lib_suffix "" ) endif( CMAKE_BUILD_TYPE STREQUAL "Debug" ) # -------------------------------------------- # Add -s to the static libs # -------------------------------------------- if( NOT BUILD_SHARED_LIBS ) set( kt_lib_suffix -s${kt_lib_suffix} ) endif( NOT BUILD_SHARED_LIBS ) # -------------------------------------------- # Add the compiler include / lib paths # to the default CMake paths # -------------------------------------------- set(CMAKE_INCLUDE_PATH $CMAKE_INCLUDE_PATH $ENV{INCLUDE}) set(CMAKE_LIBRARY_PATH $CMAKE_LIBRARY_PATH $ENV{LIB}) # -------------------------------------------- # Add the folder to the compilation libraries path # -------------------------------------------- link_directories( ../lib ) # -------------------------------------------- # Add the folder to the compilation includes path # -------------------------------------------- include_directories( ../include ) # -------------------------------------------- # Add the core module to the build # -------------------------------------------- file( GLOB_RECURSE core_source_files ../src/kT/Core/* ) file( GLOB_RECURSE core_header_files ../include/kT/Core/* ) set( ktCoreLibName ktCore${kt_lib_suffix}) add_library( ${ktCoreLibName} ${kt_lib_type} ${core_source_files} ${core_header_files} )
Partager