[CMake] How Can I compile the following code on Windows with CMake?

2009-03-30 Thread Kermit Mei
I want to add the following program as a part of my project, but I don't konw how to manage it in CMake. I worte the following in my CMakeLists.txt: FIND_LIBRARY(LIBWMM winmm) ADD_EXECUTABLE(aplay WIN32 aplay.c) TARGET_LINK_LIBRARIES(aplay ${LIBWMM}) But it always told me that "undefined ref

Re: [CMake] How can I manage the Qt4's .rc file with CMake?

2009-03-30 Thread Kermit Mei
On Mon, 2009-03-30 at 20:17 +0200, Christian Ehrlicher wrote: > Kermit Mei schrieb: > > On Mon, 2009-03-30 at 18:15 +0200, Pau Garcia i Quiles wrote: > >> On Mon, Mar 30, 2009 at 6:04 PM, Kermit Mei wrote: > >>> Hello community! I want to change my program's

Re: [CMake] How can I manage the Qt4's .rc file with CMake?

2009-03-30 Thread Kermit Mei
On Mon, 2009-03-30 at 18:15 +0200, Pau Garcia i Quiles wrote: > On Mon, Mar 30, 2009 at 6:04 PM, Kermit Mei wrote: > > Hello community! I want to change my program's icon on windows, and it > > wrote with Qt4. I looked up the assistant, it told me the following. > > &

Re: [CMake] How can I manage the Qt4's .rc file with CMake?

2009-03-30 Thread Kermit Mei
On Mon, 2009-03-30 at 12:17 -0400, John Drescher wrote: > On Mon, Mar 30, 2009 at 12:04 PM, Kermit Mei wrote: > > Hello community! I want to change my program's icon on windows, and it > > wrote with Qt4. I looked up the assistant, it told me the following. > > > >

[CMake] How can I manage the Qt4's .rc file with CMake?

2009-03-30 Thread Kermit Mei
Hello community! I want to change my program's icon on windows, and it wrote with Qt4. I looked up the assistant, it told me the following. But I don't know how to use it in cmake? And, another question: If I use MinGW+Qt, but not M$ VC++, can I use it? Thanks. ---Qt A

[CMake] How to avoid a console come out on WinXp(Cmake+Qt) ?

2009-03-29 Thread Kermit Mei
Hello, I wrote a program with Qt4, and manage it with CMake. I run it on Linux, everything goes well. But on Windows xp, there is always a console come out with the program. How to avoid it in CMAKE? By the Way, when I want to debug it, I used some std::cerr in my program. But when I setup it on W

[CMake] How can I manage Qt Style Sheets with CMake?

2009-03-19 Thread Kermit Mei
Hello all, how can I manage Qt style sheets with cmake? I can't see any look and feel customization in my program, which had set the style sheets in qt-designer. And also, I don't konw how can I make cmake recognize *.qss file in my project. Waiting for your help, thanks. Kermit ___

[CMake] How can link to a library just like the system libs?

2009-03-14 Thread Kermit Mei
Hello, I have a library which had been installed into my system under /usr/lib/. When I manually compile it, I must type: cc -Wall udpcli.c -o cli -lapue Now, I wrote my cmakelists.txt like this: CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(UDPCS) FIND_LIBRARY(APUE_LIB, /usr/lib/) ADD_EXECUTABLE(se

[CMake] Why does a mylib.dll.a file be build automatically ?

2009-03-12 Thread Kermit Mei
Hello, I use cmake with Qt4.5.0(for Win installer), and my program on can be compiled well on Linux, but when I use in windows, I want a share lib, but it always build a mylib.dll.a file with mylib.dll. And finally, when I link the targets, it can't work, and tell me: Linking CXX shared library ..\

Re: [CMake] What's wrong with the INSTALL Path error?

2009-03-12 Thread Kermit Mei
On Thu, 2009-03-12 at 08:12 -0400, Philip Lowman wrote: > On Thu, Mar 12, 2009 at 3:43 AM, Kermit Mei > wrote: > Hello, I use the cmake-command on unix and it works well, but. > But > Windows, it told me that: > > CMake Error at src/

[CMake] What's wrong with the INSTALL Path error?

2009-03-12 Thread Kermit Mei
Hello, I use the cmake-command on unix and it works well, but. But Windows, it told me that: CMake Error at src/gui/CMakeLists.txt:99 (INSTALL): install Library TARGETS given no DESTINATION! The INSTLL in CmakeLists.txt is like this: INSTALL(PROGRAMS ${PROJECT_BINARY_DIR}/bin/qfrt DESTINATION

Re: [CMake] How to add "-DDEBUG" just in command line?

2009-02-28 Thread Kermit Mei
Enrico Franchi wrote: On Feb 28, 2009, at 10:48 AM, Kermit Mei wrote: Hello, is there any elegant way to add "-DDEBUG" to the complier flag just in command line? IF(${CMAKE_BUILD_TYPE} STREQUAL Debug) MESSAGE("Adding Debug flag...") ADD_DEFINI

Re: [CMake] How to add "-DDEBUG" just in command line?

2009-02-28 Thread Kermit Mei
Enrico Franchi wrote: On Feb 28, 2009, at 10:48 AM, Kermit Mei wrote: Hello, is there any elegant way to add "-DDEBUG" to the complier flag just in command line? IF(${CMAKE_BUILD_TYPE} STREQUAL Debug) MESSAGE("Adding Debug flag...") ADD_DEFINITIONS(-DDEBUG) ENDI

[CMake] How to add "-DDEBUG" just in command line?

2009-02-28 Thread Kermit Mei
Hello, is there any elegant way to add "-DDEBUG" to the complier flag just in command line? I don't want to modify my CMakeLists.txt file, I just want to build it when I run : cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr .. I tried the following command in CMakeLists.txt: IF(CMAK

Re: [CMake] How can I install something into an absolute directory?

2009-02-20 Thread Kermit Mei
Alexander Neundorf wrote: On Monday 16 February 2009, Andreas Pakulat wrote: On 16.02.09 21:12:46, Kermit Mei wrote: How can I install something into an absolute directory? For example, I want to install the directory under /usr/share. When I use the following command: INSTALL

[CMake] How can I install something into an absolute directory?

2009-02-16 Thread Kermit Mei
, if I run cmake -DCMAKE_INSTALL_PREFIX=/usr/local .. How to avoid it, and guarantee it can be install under /usr/share whatevery I pointed with cmake PREFIX ? Thanks. Kermit Mei ___ Powered by www.kitware.com Visit other Kitware open-source project

[CMake] Errors when creating a share library for Qt-application ?

2009-01-21 Thread Kermit Mei
qmake) INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR}/src/gui ) ADD_LIBRARY(FreeReciteGui SHARED ${FRGUI_SRCS} ${FRGUI_MOC_SRC} ${FRGUI_UI_HDRS} ) INSTALL(TARGETS FreeReciteGui LIBRARY DESTINATION lib) ______

Re: [CMake] Why the ui_header.h can not be found in Qt project when I add a share lib?

2009-01-20 Thread Kermit Mei
Michael Jackson wrote: TARGET_LINK_LIBRARIES( gtc GUI ${QT_LIBRARIES} ) Also BEFORE the FindPackage(Qt4) add the following line: IF (WIN32) SET (QT_USE_QTMAIN TRUE) It works. But what's the meaning here? I hope you can give me some links. I googled it, but I can't find enough answers for

Re: [CMake] Why the ui_header.h can not be found in Qt project when I add a share lib?

2009-01-20 Thread Kermit Mei
Clinton Stimpson wrote: How about using ${GUI_UIS} instead of ${SAMPLE_UIS}, which is undefined. Clint Hmm, thank you. I had repired some erros, and the GUI.so can be created. But the new troubles come: $ make [ 20%] Generating ui_gotocelldialog.h [ 40%] Generating moc_gotocelldialog.cxx Sc

[CMake] Why the ui_header.h can not be found in Qt project when I add a share lib?

2009-01-20 Thread Kermit Mei
Hello,I'm a novice for cmake. I'm trying to run a qt-project like this: $ tree . |-- CMakeLists.txt |-- build |-- gui //I want creat a share lib here. | |-- CMakeLists.txt | |-- gotocelldialog.cpp | |-- gotocelldialog.h | `-- gotocelldialog.ui `-- main.cpp 2 directories, 6 files The CMakeList

Re: [CMake] A strange problem when I "rm -rf *" under project/build.

2009-01-19 Thread Kermit Mei
Philip Lowman wrote: On Mon, Jan 19, 2009 at 1:59 AM, Kermit Mei <mailto:kermit@gmail.com>> wrote: Hello, I create my project in the directory ~/project. And then, I build it in ~/project/build as the following: cd ~/project mkdir build cd build

Re: [CMake] A strange problem when I "rm -rf *" under project/build.

2009-01-19 Thread Kermit Mei
Philip Lowman wrote: On Mon, Jan 19, 2009 at 1:59 AM, Kermit Mei <mailto:kermit@gmail.com>> wrote: Hello, I create my project in the directory ~/project. And then, I build it in ~/project/build as the following: cd ~/project mkdir build cd build

[CMake] A strange problem when I "rm -rf *" under project/build.

2009-01-18 Thread Kermit Mei
Hello, I create my project in the directory ~/project. And then, I build it in ~/project/build as the following: cd ~/project mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=/usr .. make sudo make install So far, everything of my program works well. But, if I delete the files under ~/project

Re: [CMake] Unable to find GTK with cmake on Ubuntu

2009-01-11 Thread Kermit Mei
Hi, how about this CMakeLists.txt? I use it to test my GTK+ programs, and it always work well;p cmake_minimum_required(VERSION 2.6) INCLUDE(UsePkgConfig) FIND_PACKAGE(GTK) IF (GTK_FOUND) INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIR}) ADD_DEFINITIONS(-DHAVE_GTK) MESSAGE("GTK 1.x found and

Re: [CMake] How can I add -gstabs to the compile item for Debug?

2008-12-19 Thread Kermit Mei
Werner Smekal wrote: Hi, cmake -DCMAKE_CXX_FLAGS_DEBUG="-g" CMAKE_INSTALL_PREFIX=/usr .. But the result is: This GDB was configured as "i486-linux-gnu"... (gdb) b main Breakpoint 1 at 0x80487b3 (gdb) r Starting program: /home/kermit/Project/FreeRecite/build/bin/FreeRecite-core Breakpoint 1

Re: [CMake] How can I add -gstabs to the compile item for Debug?

2008-12-18 Thread Kermit Mei
Bill Hoffman wrote: Tyler Roscoe wrote: On Fri, Dec 19, 2008 at 01:33:45AM +0800, Kermit Mei wrote: c++ -Wall -gstabs(or -g) main.cpp hello.cpp -o main How can I use cmake to do the same thing? Add your -g flag to CMAKE_CXX_FLAGS or I think you can use ADD_DEFINITIONS("-g"). I

Re: [CMake] How can I add -gstabs to the compile item for Debug?

2008-12-18 Thread Kermit Mei
Tyler Roscoe wrote: On Fri, Dec 19, 2008 at 01:33:45AM +0800, Kermit Mei wrote: c++ -Wall -gstabs(or -g) main.cpp hello.cpp -o main How can I use cmake to do the same thing? Add your -g flag to CMAKE_CXX_FLAGS or I think you can use ADD_DEFINITIONS("-g"). tyler Thank

[CMake] How can I add -gstabs to the compile item for Debug?

2008-12-18 Thread Kermit Mei
ke to do the same thing? Thanks! Kermit Mei ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] How to delete a link with "make uninstall" ?

2008-12-13 Thread Kermit Mei
Philip Lowman wrote: On Wed, Dec 10, 2008 at 2:13 PM, Kermit Mei <mailto:kermit@gmail.com>> wrote: http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F Hello, I config my project as the above told. Everything is OK when I "make unins

Re: [CMake] How can I write CMakeLists.txt to link a special library?

2008-12-13 Thread Kermit Mei
Werner Smekal wrote: Hi, Kermit Mei wrote: Hello, all. I used sigc++ library in my program, so I must compile my main.cc like this: c++ -Wall main.cc -o main -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -lsigc-2.0 Then, how can I write the CMakeLists.txt? I worte it like this

[CMake] How can I write CMakeLists.txt to link a special library?

2008-12-13 Thread Kermit Mei
ADD_EXECUTABLE(main ${SRC_LIST}) # But I can't link the libsigc. Thanks. Kermit Mei ___ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] How to add a libaray for another libaray?

2008-12-10 Thread Kermit Mei
James Bigler wrote: There are a couple of things that either you have done wrong or I don't understand. This is how I would implement things: core/CMakeLists.txt SET(SRC_LIST ConfigHolder.cpp DictItem.cpp Reciter.cpp ForgetCurve.cpp Task.cpp Dict.cpp Manager.cpp WordList.cpp) ADD_LIBRARY(co

[CMake] How to delete a link with "make uninstall" ?

2008-12-10 Thread Kermit Mei
eciteCore.so -> libFreeReciteCore.so.1.0 `-- libFreeReciteUi.so -> libFreeReciteUi.so.1.0 2 directories, 2 files $ --- My install file is: $ cat ../install_manifest.txt FreeRecite FreeRecite-core libFreeReciteCore.so libFreeReciteCore.so.1

[CMake] How to add a libaray for another libaray?

2008-12-09 Thread Kermit Mei
Hello, My project is layout like this: Linux-cmd$ tree . |-- CMakeLists.txt |-- core | |-- CMakeLists.txt | |-- ... ... ... | |-- (Some source files to implement the internal function.) `-- ui |-- CMakeLists.txt |-- ... ... ... |-- (Some source files to impliment the UI) |-- main.cpp