Re: [CMake] LINK_LIBRARIES() does not respect SUFFIX/PREFIX
Great! A while ago I tried to cross-compile code for win32 with mingw from linux and ran into the same problem with the library PREFIX and SUFFIX. Setting the PREFIX and SUFFIX globally works great, cross-compiling now works good for my project (and much faster than the native compile with mingw on windows.) SET(CMAKE_STATIC_LIBRARY_PREFIX ) SET(CMAKE_STATIC_LIBRARY_SUFFIX .dll) SET(CMAKE_EXECUTABLE_SUFFIX .exe) Thanks, Peter. This problem is now solved. For anyone else facing this with crosscompiling here are is what I did. In the top level CMakeLists.txt I put in the following: PROJECT(myProj) SET(CMAKE_STATIC_LIBRARY_PREFIX lib) SET(CMAKE_STATIC_LIBRARY_SUFFIX .a) SET(CMAKE_EXECUTABLE_SUFFIX .elf) Some of my leqrnings; 1) The prefix and suffix information must and should be placed after declaring the project. If it is put before, then it gets overwritten when project is declared. Can any of the developers throw more light on the various effects that declaring a project has? 2) When cross-compiling, the CMAKE_C_COMPILER and CMAKE_CXX_COMPILER must be set *before* declaring the project. It gets *committed* when a project is declared and cannot be changed without deleting the build. Warm regards, Kishore ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
[CMake] INCLUDE_DIRECTORIES oddity
Hello, I'm experiencing an odd behaviour of the INCLUDE_DIRECTORY command. Here's the relevant code: INCLUDE(UsePkgConfig) FOREACH(library sdl libpng freetype2) PKGCONFIG(${library} INC LIB LD C) IF(C) INCLUDE_DIRECTORIES(${C}) TARGET_LINK_LIBRARIES(wowtris ${LD}) ELSE(C) MESSAGE(FATAL_ERROR ${library} is missing.) ENDIF(C) ENDFOREACH(library) Here's what happens when I make: /usr/bin/c++ -I/home/siovene/projects/wowtris -I/home/siovene/projects/wowtris/-D_GNU_SOURCE=1\ -D_REENTRANT\ -I/usr/include/SDL -I/home/siovene/projects/wowtris/ -I/home/siovene/projects/wowtris/-I/usr/include/freetype2 -I/usr/include/GL -o CMakeFiles/wowtris.dir/src/Application.o -c /home/siovene/projects/wowtris/src/Application.cpp Notice how things like -I/usr/include/libpng12 get _prefixed_ by -I/home/siovene/projects/wowtris/, so that the final include path will be wrong. Am I doing something obviously wrong? My cmake version is 2.4-patch 5. Thank you. -- Salvatore Iovene http://www.iovene.com signature.asc Description: PGP signature ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] INCLUDE_DIRECTORIES oddity
Salvatore Iovene wrote: Am I doing something obviously wrong? Using an older version of CMake when making a bug report? :-) My cmake version is 2.4-patch 5. See if it's a problem with 2.4.6. Cheers, Brandon Van Every ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] INCLUDE_DIRECTORIES oddity
On Sat, 24 Mar 2007 07:56:21 -0700 Brandon J. Van Every [EMAIL PROTECTED] wrote: Salvatore Iovene wrote: Am I doing something obviously wrong? Using an older version of CMake when making a bug report? :-) I'm not filing a bug report, as nowhere I alleged this would be a cmake bug. I was just asking on the mailing list. My cmake version is 2.4-patch 5. See if it's a problem with 2.4.6. Actually the thing seem to be that cmake adds -I/path/to/my_project to what it finds in the .pc files. Using ADD_DEFINITION instead of INCLUDE_DIRECTORIES removes the problem, but I don't think this would the best way. -- Salvatore Iovene http://www.iovene.com signature.asc Description: PGP signature ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Problem using cmake with mingw
Claudiu-Daniel wrote: I'm trying to compile OIS with cmake I've managed to do this with a VS 2005 solution generated by cmake and it works fine but when i try to do it with a mingw makefile I get this error D:\ScatteredLands\Project\trunk\buildgccmingw32-make Scanning dependencies of target ois [ 0%] Building CXX object external/ois-1.0RC1/CMakeFiles/ois.dir/src/OISEffect.obj [ 1%] Building CXX object external/ois-1.0RC1/CMakeFiles/ois.dir/src/OISForceFeedback.obj mingw32-make[2]: *** No rule to make target `C:/Program Files/Microsoft DirectX SDK \(February 2007\)/Include/dinput.h', needed by `external/ois-1.0RC1/CMak eFiles/ois.dir/src/OISInputManager.obj'. Stop. mingw32-make[1]: *** [external/ois- 1.0RC1/CMakeFiles/ois.dir/all] Error 2 mingw32-make: *** [all] Error 2 This is a bug in 2.4.6, it is fixed CVS and will be fixed in 2.4.7. 2.4.6 and below had problems with () in the path. -Bill ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Problem using cmake with mingw
Bill Hoffman schrieb: Claudiu-Daniel wrote: I'm trying to compile OIS with cmake I've managed to do this with a VS 2005 solution generated by cmake and it works fine but when i try to do it with a mingw makefile I get this error D:\ScatteredLands\Project\trunk\buildgccmingw32-make Scanning dependencies of target ois [ 0%] Building CXX object external/ois-1.0RC1/CMakeFiles/ois.dir/src/OISEffect.obj [ 1%] Building CXX object external/ois-1.0RC1/CMakeFiles/ois.dir/src/OISForceFeedback.obj mingw32-make[2]: *** No rule to make target `C:/Program Files/Microsoft DirectX SDK \(February 2007\)/Include/dinput.h', needed by `external/ois-1.0RC1/CMak eFiles/ois.dir/src/OISInputManager.obj'. Stop. mingw32-make[1]: *** [external/ois- 1.0RC1/CMakeFiles/ois.dir/all] Error 2 mingw32-make: *** [all] Error 2 This is a bug in 2.4.6, it is fixed CVS and will be fixed in 2.4.7. 2.4.6 and below had problems with () in the path. But the log shows another problem - mingw can not use MS PSDK headers. Christian signature.asc Description: OpenPGP digital signature ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] INCLUDE_DIRECTORIES oddity
Hello, I'm experiencing an odd behaviour of the INCLUDE_DIRECTORY command. Here's the relevant code: INCLUDE(UsePkgConfig) FOREACH(library sdl libpng freetype2) PKGCONFIG(${library} INC LIB LD C) IF(C) INCLUDE_DIRECTORIES(${C}) TARGET_LINK_LIBRARIES(wowtris ${LD}) ELSE(C) MESSAGE(FATAL_ERROR ${library} is missing.) ENDIF(C) ENDFOREACH(library) I think you will find the source of your trouble is the PKGCONFIG macro. Dump out ${C} and ${LD} inside the FOREACH loop, and I believe you will see space-separated strings which you will have to convert to lists (semi-colon separated strings) before using them in INCLUDE_DIRECTORIES and TARGET_LINK_LIBRARIES. There is an outstanding replacement for PKGCONFIG in the CVS version of CMake called PKG_CHECK_MODULES which is in the find module FindPkgConfig.cmake. Simultaneously, UsePkgConfig.cmake and the included PKGCONFIG macro are deprecated in CVS. Question for the CMake developers: is FindPkgConfig.cmake and PKGCONFIG with deprecation message going into 2.4.7? It would be good to finally put to rest these blank-separated and other issues with PKGCONFIG that all new users seem to encounter. (Actually, all questions about the CVS versions of FindPkgConfig.cmake and UsePkgConfig.cmake were settled prior to 2.4.6, but somehow those tested CVS versions did not make it into that release.) Alan __ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __ Linux-powered Science __ ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake
Re: [CMake] Problem using cmake with mingw
Am Samstag 24 März 2007 20:29 schrieb Christian Ehrlicher: But the log shows another problem - mingw can not use MS PSDK headers. That's not completely true. For some particular headers that have things that mingw does not provide (e.g. the bluetooth stuff), you can copy them and use them as-is (some warnings may pop up as they use some sloppy coding). HS ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake