[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 Assistant
Setting the Application Icon on Windows

First, create an ICO format bitmap file that contains the icon image.
This can be done with e.g. Microsoft Visual C++: Select File|New, then
select the File tab in the dialog that appears, and choose Icon. (Note
that you do not need to load your application into Visual C++; here we
are only using the icon editor.)

Store the ICO file in your application's source code directory, for
example, with the name myappico.ico. Then, create a text file called,
say, myapp.rc in which you put a single line of text:

IDI_ICON1   ICONDISCARDABLE myappico.ico

Finally, assuming you are using qmake to generate your makefiles, add
this line to your myapp.pro file:

RC_FILE = myapp.rc

Regenerate your makefile and your application. The .exe file will now be
represented with your icon in Explorer.

If you do not use qmake, the necessary steps are: first, run the rc
program on the .rc file, then link your application with the
resulting .res file.
---

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


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 kermit@gmail.com 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.
 
  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?
 
 
 Shouldn't that be qrc for Qt4? And then you use something like this in
 your CMakeLists.txt
 
 # and finally an resource file
 SET( UPMC_LA_RCS
   ./rc/LungAnalysis.qrc
 )
 
 # this command will generate rules that will run rcc on all files from
 UPMC_LA_RCS
 # in result UPMC_LA_RC_SRCS variable will contain paths to files produced by 
 rcc
 QT4_ADD_RESOURCES( UPMC_LA_RC_SRCS ${UPMC_LA_RCS} )
 
 
 John
No, John,it's not qrc, and what you said I had used before. What I want
is to change the icon of myapp.exe. 

Thank you,all the same;p


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


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 kermit@gmail.com 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.
 
  But I don't know how to use it in cmake?
 
 Just add the .rc file to the sources list, like it was another .cpp file:
 
 ADD_EXECUTABLE( myexe source1.cpp source2.cpp resource.rc )
 
  And, another question: If I use MinGW+Qt, but not M$ VC++, can I use it?
 
 I think so, yes.

Hi Pau, What you said I have tried. But nothing changed in the view of
myexe, it is also a ugly white area with a blue barrier;p
I do it like this:
IF(WIN32)
  ADD_EXECUTABLE(qfrt WIN32 qfrt.cpp qfrt.rc)
ELSE(WIN32)
  ADD_EXECUTABLE(qfrt qfrt.cpp)
ENDIF(WIN32)

And the content of qfrt.rc is:
IDI_ICON1   ICONDISCARDABLE :/icon/myapp.ico

and I also tried ./gui/icon/myapp.ico where the .ico file exists.

Thank you, all the same. And hope more help;p

snip

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


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 kermit@gmail.com 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.
 
  But I don't know how to use it in cmake?
  Just add the .rc file to the sources list, like it was another .cpp file:
 
  ADD_EXECUTABLE( myexe source1.cpp source2.cpp resource.rc )
 
  And, another question: If I use MinGW+Qt, but not M$ VC++, can I use it?
  I think so, yes.
  
  Hi Pau, What you said I have tried. But nothing changed in the view of
  myexe, it is also a ugly white area with a blue barrier;p
  I do it like this:
  IF(WIN32)
ADD_EXECUTABLE(qfrt WIN32 qfrt.cpp qfrt.rc)
  ELSE(WIN32)
ADD_EXECUTABLE(qfrt qfrt.cpp)
  ENDIF(WIN32)
  
  And the content of qfrt.rc is:
  IDI_ICON1   ICONDISCARDABLE :/icon/myapp.ico
  
  and I also tried ./gui/icon/myapp.ico where the .ico file exists.
  
  Thank you, all the same. And hope more help;p
  
 This is working fine on windows with msvc but will not work with mingw:
 http://public.kitware.com/Bug/view.php?id=4068
 
 
 Christian

WoW, Thank you, very very muck;p

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[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 Windows, it always shows me a memory
error whereas it goes well on Linux. Is it about CMake, or something I
set error? In qmake, the console should be set in CONFIG for windows, so
I don't know how about Linux.

Thanks. 

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[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

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[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(serv udpserv.c)
ADD_EXECUTABLE(cli udpcli.c)
TARGET_LINK_LIBRARIES(cli, ${APUE_LIB})

And then I encounter the following errors: 
$ cmake -DBUILD_TYPE=debug ..
CMake Error: Attempt to add link library /usr/lib/libapue.so to target
cli, which is not built by this project.
-- Configuring done

How can I settle it?

Thanks.

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[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 bin)

Why?

Thanks.
Kermit

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


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 kermit@gmail.com
 wrote:
 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
 bin)
 
 From the documentation about PROGRAMS mode:
 
 The PROGRAMS form is identical to the FILES form except that the
 default permissions for the installed file also include OWNER_EXECUTE,
 GROUP_EXECUTE, and WORLD_EXECUTE. This form is intended to install
 programs that are not targets, such as shell scripts. Use the TARGETS
 form to install targets built within the project.
 
 
 Try INSTALL(TARGETS qfrt RUNTIME DESTINATION bin).  This is assuming
 your qfrt executable is being created by add_executable(qfrt ...)
 
 Unlike the Makefile generator, the Visual Studio generator for CMake
 doesn't output qfrt in ${PROJECT_BINARY_DIR}/bin so CMake can't find
 it.
Thank you, and that helped me;p


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[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 ..\..\lib\libFreeReciteGui.dll
...(some undefined errors)...

I detected the lib directory, and libFreeReciteGui.dll haven't been
built, but a libFreeReciteGui.dll be built. Why?
The CMakeLists.txt for this library is:
###
##$ cat ../src/gui/CMakeLists.txt 
###
# Include the core library.
INCLUDE_DIRECTORIES(${FREERECITE_SOURCE_DIR}/src/core)
# Make sure the compiler can find include files from our ui library.
INCLUDE_DIRECTORIES(${FREERECITE_BINARY_DIR}/src/gui)
# Make sure the linker can find the ui library once it is built.
LINK_DIRECTORIES(${FREERECITE_BINARY_DIR}/lib)

SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)

# with SET() command you can change variables or define new ones
# here we define SAMPLE_SRCS variable that contains a list of all .cpp
files
# note that we don't need \ at the end of line
SET( FR_SRCS
Speaker.h
Speaker.cpp
)

SET( FRGUI_SRCS
  AddDialog.cpp
  MainWindow.cpp
  MainWidget.cpp
  ModifyDialog.cpp
  TaskModel.cpp
  ScannerWidget.cpp
  ReciterWidget.cpp
  ResultWidget.cpp
  TesterWidget.cpp
  )
  
# another list, this time it includes all header files that should be
treated with moc
SET( FRGUI_MOC_HDRS
  AddDialog.h
  MainWindow.h
  MainWidget.h
  ModifyDialog.h
  TaskModel.h
  ScannerWidget.h
  ReciterWidget.h
  ResultWidget.h
  TesterWidget.h
  )

# some .ui files
SET( FRGUI_UIS
  AddDialog.ui
  MainWindow.ui
  MainWidget.ui
  ModifyDialog.ui
  ResultWidget.ui
  ScannerWidget.ui
  )

# and finally an resource file
#SET( FRGUI_RCS
#  ./src/rc/sample.qrc
#  )

# enable warnings
ADD_DEFINITIONS( -Wall )
  
# by default only QtCore and QtGui modules are enabled
# other modules must be enabled like this:

#SET( QT_USE_QT3SUPPORT TRUE )   

#SET( QT_USE_QTXML TRUE )

# this command finds Qt4 libraries and sets all required variables
# note that it's Qt4, not QT4 or qt4
FIND_PACKAGE( Qt4 REQUIRED )

SET( QT_USE_QTWEBKIT TRUE )

# add some useful macros and variables
# (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 ) that
contains a path to CMake script)
INCLUDE( ${QT_USE_FILE} )

# this command will generate rules that will run rcc on all files from
FRGUI_RCS
# in result FRGUI_RC_SRCS variable will contain paths to files produced
by rcc
#QT4_ADD_RESOURCES( FRGUI_RC_SRCS ${FRGUI_RCS} )

# this will run uic on .ui files:
QT4_WRAP_UI( FRGUI_UI_HDRS ${FRGUI_UIS} )

# and finally this will run moc:
QT4_WRAP_CPP( FRGUI_MOC_SRCS ${FRGUI_MOC_HDRS} )

ADD_LIBRARY(FreeReciteGui SHARED
  ${FRGUI_SRCS}
  ${FRGUI_MOC_SRCS}
  ${FRGUI_UI_HDRS}
  ${FR_SRCS}
  )

TARGET_LINK_LIBRARIES(FreeReciteGui FreeReciteCore ${QT_LIBRARIES})

INSTALL(TARGETS LIBRARY DESTINATION lib)
###

And by the way, it works well on Linux. Another share library is
FreeReciteCore.dll, and it also be built on Windows.

Help me, please;p
Thanks for any replay!
Kermit

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[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(CMAKE_BUILD_TYPE == debug)
 add_definitions(-DDEBUG)
ENDIF()

But nothing did ...

Thanks
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


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)
ENDIF(${CMAKE_BUILD_TYPE} STREQUAL Debug)


Thanks, but when I run without debug, something goes wrong:
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
CMake Error at CMakeLists.txt:9 (IF):
if had incorrect arguments: ${CMAKE_BUILD_TYPE} STREQUAL Debug (Unknown 
arguments specified).

... ...
Adding Debug flag...


As you see, Whenever I set -DCMAKE_BUILD_TYPE=Debug,
the statement within if-endif is always be run.



___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

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)
ENDIF(${CMAKE_BUILD_TYPE} STREQUAL Debug)


I had google it, and everything goes well:


OPTION(DEFINE_DEBUG
 Build the project using debugging code
 OFF)
IF(DEFINE_DEBUG)
 MESSAGE(Adding Debug flag...)
 ADD_DEFINITIONS(-DDEBUG)
 SET(CMAKE_BUILD_TYPE Debug)
 MESSAGE(Build type is  ${CMAKE_BUILD_TYPE})
ENDIF(DEFINE_DEBUG)

And ues the following command to add debug build:
$ cmake -DDEFINE_DEBUG=ON -DCMAKE_INSTALL_PREFIX=/usr ..

Thank you, all the same;p

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


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(DIRECTORY ${CMAKE_SOURCE_DIR}/dict/mydir DESTINATION share)

'mydir' may be installed into /usr/local/share, if I run
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
  

Thats correct and the right thing to happen.



How to avoid it, and guarantee it can be install under /usr/share
whatevery I
pointed with cmake PREFIX ?
  

Your app should not need that, in particular nothing that builds from
source should install into a directory thats controlled by a distributions
packaging system. Apart from that, something like this would probably break
how distributions build a package from such sources.



Andreas is right, but if you really want it, you can simply put the absolute 
path as the destination:

INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/dict/mydir DESTINATION /usr/share)

(haven't tried this with DIRECTORY mode, but works for files and targets).

Alex

  

Thanks;p

___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


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

2009-02-16 Thread Kermit Mei

Hello, community!

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(DIRECTORY ${CMAKE_SOURCE_DIR}/dict/mydir DESTINATION share)

'mydir' may be installed into /usr/local/share, 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 projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


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

2009-01-21 Thread Kermit Mei

Hello, I want to use the following files under the directory gui to
creat a share library named FreeReciteGui.so .


$ tree
gui
|-- CMakeLists.txt
|-- MainWindow.cpp
|-- MainWindow.h
|-- MainWindow.ui
|-- ReciterWidget.cpp
|-- ReciterWidget.h
|-- ScannerWidget.cpp
|-- ScannerWidget.h
|-- ScannerWidget.ui
|-- TaskModel.cpp
|-- TaskModel.h
|-- TesterWidget.cpp
`-- TesterWidget.h

When I link the program to this library, it always hint me:

Linking CXX shared library libFreeReciteGui.so
[ 36%] Built target FreeReciteGui
[ 94%] Built target FreeReciteCore
Linking CXX executable ../bin/FreeRecite-core
gui/libFreeReciteGui.so: undefined reference to `vtable for ScannerWidget'
gui/libFreeReciteGui.so: undefined reference to 
`ScannerWidget::complished()'
gui/libFreeReciteGui.so: undefined reference to 
`ScannerWidget::qt_metacall(QMetaObject::Call, int, void**)'

gui/libFreeReciteGui.so: undefined reference to `typeinfo for ScannerWidget'
gui/libFreeReciteGui.so: undefined reference to `vtable for MainWindow'
gui/libFreeReciteGui.so: undefined reference to 
`ScannerWidget::staticMetaObject'
gui/libFreeReciteGui.so: undefined reference to 
`ScannerWidget::metaObject() const'
gui/libFreeReciteGui.so: undefined reference to 
`ScannerWidget::qt_metacast(char const*)'

collect2: ld returned 1 exit status
make[2]: *** [bin/FreeRecite-core] Error 1
make[1]: *** [src/CMakeFiles/FreeRecite-core.dir/all] Error 2
make: *** [all] Error 2
$

But, in my model-testing with qmake, ScannerWidget and it's subclass are all
work well. So I think there must be something wrong with CMakeLists.txt 
here.

Help me point it out, please.
The contents of CMaskLists.txt is :

$ cat ../src/gui/CMakeLists.txt
# Include the core library.
INCLUDE_DIRECTORIES(${FREERECITE_SOURCE_DIR}/src/core)

LINK_DIRECTORIES(${FREERECITE_BINARY_DIR}/src/core)

# with SET() command you can change variables or define new ones
# here we define SAMPLE_SRCS variable that contains a list of all .cpp files
# note that we don't need \ at the end of line
SET( FRGUI_SRCS
 MainWindow.cpp
 ScannerWidget.cpp
 ReciterWidget.cpp
 TesterWidget.cpp
 TaskModel.cpp
 )

# another list, this time it includes all header files that should be 
treated with moc

SET( FRGUI_MOC_HDRS
 MainWindow.h
 ScannerWidget.h
 ReciterWidget.h
 TesterWidget.h
 TaskModel.h
)

# some .ui files
SET( FRGUI_UIS
 MainWindow.ui
 ScannerWidget.ui
 )

# and finally an resource file
#SET( FRGUI_RCS
#  ./src/rc/sample.qrc
#  )

# enable warnings
ADD_DEFINITIONS( -Wall )

# by default only QtCore and QtGui modules are enabled
# other modules must be enabled like this:

#SET( QT_USE_QT3SUPPORT TRUE )  


#SET( QT_USE_QTXML TRUE )

# this command finds Qt4 libraries and sets all required variables
# note that it's Qt4, not QT4 or qt4
FIND_PACKAGE( Qt4 REQUIRED )

# add some useful macros and variables
# (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 ) that 
contains a path to CMake script)

INCLUDE( ${QT_USE_FILE} )

# this command will generate rules that will run rcc on all files from 
FRGUI_RCS
# in result FRGUI_RC_SRCS variable will contain paths to files produced 
by rcc

#QT4_ADD_RESOURCES( FRGUI_RC_SRCS ${FRGUI_RCS} )

# this will run uic on .ui files:
QT4_WRAP_UI( FRGUI_UI_HDRS ${FRGUI_UIS} )

# and finally this will run moc:
QT4_WRAP_CPP( FRGUI_MOC_SRCS ${FRGUI_MOC_HDRS} )

# we need this to be able to include headers produced by uic in our code
# (CMAKE_BINARY_DIR holds a path to the build directory,
# while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from 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)


__

Thank you, very much.

Kermit Mei



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[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 CMakeLists.txt of the root is:
$ cat CMakeLists.txt

###
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT( GTC )

ADD_SUBDIRECTORY( gui )

INCLUDE_DIRECTORIES(${GTC_SOURCE_DIR}/gui)
LINK_DIRECTORIES(${GTC_BINARY_DIR}/gui)

ADD_DEFINITIONS( -Wall )

FIND_PACKAGE( Qt4 REQUIRED )

INCLUDE( ${QT_USE_FILE} )

SET( GTC_SRCS main.cpp )

INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )

ADD_EXECUTABLE( gtc ${GTC_SRCS} )
SET(EXECUTABLE_OUT_PATH ${CMAKE_BINARY_DIR})
TARGET_LINK_LIBRARIES( gtc GUI )
#END###





And the /gui/CMakeLists.txt is like this:
$ cat gui/CMakeLists.txt
###
SET( GUI_SRCS
gotocelldialog.cpp
)

SET( GUI_MOC_HDRS
gotocelldialog.h
)

SET( GUI_UIS
gotocelldialog.ui
)

ADD_DEFINITIONS( -Wall )

FIND_PACKAGE( Qt4 REQUIRED )

INCLUDE( ${QT_USE_FILE} )

QT4_WRAP_UI( GUI_UI_HDRS ${SAMPLE_UIS} )

QT4_WRAP_CPP( GUI_MOC_SRCS ${GUI_MOC_HDRS} )

INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} )

ADD_LIBRARY(GUI SHARED ${GUI_SRCS} ${GUI_MOC_SRCS} ${GUI_UI_HDRS} )
###END##


But, the make result is :
$ make
[ 25%] Generating moc_gotocelldialog.cxx
Scanning dependencies of target GUI
[ 50%] Building CXX object gui/CMakeFiles/GUI.dir/gotocelldialog.cpp.o
In file included from 
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.cpp:3:
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.h:6:31: error: 
ui_gotocelldialog.h: No such file or directory
In file included from 
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.cpp:3:
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.h:8: error: ‘Ui’ has 
not been declared
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.h:8: error: expected 
`{' before ‘GoToCellDialog’
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.h:8: error: function 
definition does not declare parameters
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.cpp:5: error: invalid 
use of incomplete type ‘class GoToCellDialog’
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.h:8: error: forward 
declaration of ‘class GoToCellDialog’
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.cpp:17: error: 
invalid use of incomplete type ‘class GoToCellDialog’
/home/kermit/test/cmqt/gotocell/gui/gotocelldialog.h:8: error: forward 
declaration of ‘class GoToCellDialog’

make[2]: *** [gui/CMakeFiles/GUI.dir/gotocelldialog.cpp.o] Error 1
make[1]: *** [gui/CMakeFiles/GUI.dir/all] Error 2
make: *** [all] Error 2
$



What's wrong with it? The source code is correct, and I can use qmake to
compile and run it.

Thank you, very muck!
Kermit

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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
Scanning dependencies of target GUI
[ 60%] Building CXX object gui/CMakeFiles/GUI.dir/gotocelldialog.cpp.o
[ 80%] Building CXX object gui/CMakeFiles/GUI.dir/moc_gotocelldialog.cxx.o
Linking CXX shared library libGUI.so
[ 80%] Built target GUI
Scanning dependencies of target gtc
[100%] Building CXX object CMakeFiles/gtc.dir/main.cpp.o
Linking CXX executable gtc
CMakeFiles/gtc.dir/main.cpp.o: In function `main':
main.cpp:(.text+0x138): undefined reference to 
`QApplication::QApplication(int, char**, int)'

main.cpp:(.text+0x188): undefined reference to `QApplication::exec()'
main.cpp:(.text+0x195): undefined reference to 
`QApplication::~QApplication()'
main.cpp:(.text+0x1ab): undefined reference to 
`QApplication::~QApplication()'

gui/libGUI.so: undefined reference to `QLabel::setBuddy(QWidget*)'
gui/libGUI.so: undefined reference to `QString::free(QString::Data*)'
gui/libGUI.so: undefined reference to `QWidget::devType() const'
gui/libGUI.so: undefined reference to `QHBoxLayout::QHBoxLayout()'
gui/libGUI.so: undefined reference to `QDialog::sizeHint() const'
gui/libGUI.so: undefined reference to `QWidget::dropEvent(QDropEvent*)'
gui/libGUI.so: undefined reference to `QWidget::languageChange()'
gui/libGUI.so: undefined reference to `QWidget::leaveEvent(QEvent*)'
gui/libGUI.so: undefined reference to `QDialog::showEvent(QShowEvent*)'
gui/libGUI.so: undefined reference to `QWidget::hideEvent(QHideEvent*)'
gui/libGUI.so: undefined reference to `QDialog::setVisible(bool)'
gui/libGUI.so: undefined reference to `vtable for QLayoutItem'
……  snip  ……
gui/libGUI.so: undefined reference to `QDialog::reject()'
collect2: ld returned 1 exit status
make[2]: *** [gtc] Error 1
make[1]: *** [CMakeFiles/gtc.dir/all] Error 2
make: *** [all] Error 2



And the new CMakeLists of the main.cpp's directory is like this:

CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT( GTC )

FIND_PACKAGE( Qt4 REQUIRED )

INCLUDE( ${QT_USE_FILE} )

ADD_SUBDIRECTORY( gui )

INCLUDE_DIRECTORIES(${GTC_SOURCE_DIR}/gui)
LINK_DIRECTORIES(${GTC_BINARY_DIR}/gui)

ADD_DEFINITIONS( -Wall )

SET( GTC_SRCS main.cpp )

INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR}/gui )
INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR}/gui )



ADD_EXECUTABLE( gtc ${GTC_SRCS} )

SET(EXECUTABLE_OUT_PATH ${CMAKE_BINARY_DIR})

TARGET_LINK_LIBRARIES( gtc GUI )

What's the matter?
Thanks again;p

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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 me.

ENDIF (WIN32)

_
Mike Jackson  mike.jack...@bluequartz.net
BlueQuartz Softwarewww.bluequartz.net
Principal Software Engineer  Dayton, Ohio

Thank you!


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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 kermit@gmail.com 
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 -DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install

So far, everything of my program works well.

But, if I delete the files under ~/project/build/*,
My program will come back to the last version.

Why?


Is it possible you're setting your PATH environment variable to 
include ~/project/build or something like that so by removing it the 
system is falling back on /usr/bin?


Try running which your_program_name before and after removing 
~/project/build/*.


The cause is that make install can't install a lib of my program. But 
I don't know

why.  Look, it's interesting:

$ pwd
/home/kermit/FreeRecite/build
$ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
..everything is OK!
...[100%] Built target FreeRecite-core
$ sudo make install
[ 84%] Built target FreeReciteCore
[ 92%] Built target FreeReciteUi
[100%] Built target FreeRecite-core
Install the project...
-- Install configuration: 
-- Installing: /usr/share/FreeRecite
-- Up-to-date: /usr/share/FreeRecite/freeRecite.dict
-- Up-to-date: /usr/share/FreeRecite/freeRecite.mgr
-- Up-to-date: /usr/bin/FreeRecite
-- Installing: /usr/bin/FreeRecite-core
-- Installing: /usr/lib/libFreeReciteCore.so
-- Installing: /usr/lib/libFreeReciteUi.so

Now, everything looks well, run my program:
$ FreeRecite
New Edition of CUI##If the libFreeReciteUi.so is new,then show it.

New Edition!  ##If the programe FreeRecite-core is new, then 
show it.


$ sudo rm -rf *   ## Delete all the file under the out-compiling 
directory build


Then run the program again:
$ FreeRecite
## It haven't shown the  New Edition of CUI 
New Edition! ## Juse the FreeRecite-core is new.


But when I use the command :
$ ls -l /usr/lib/libFreeRecite*
-rw-r--r-- 1 root root 166504 2009-01-19 16:12 /usr/lib/libFreeReciteCore.so
-rw-r--r-- 1 root root  70463 2009-01-19 16:12 /usr/lib/libFreeReciteUi.so

It shows that the two libs are created right now.

Besides, I had remove the lib under /usr/lib/libFreeReciteCore.so by 
hand, and

mv the new one to instead of it.  The result is also shows the last edition.


What's wrong?



___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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 kermit@gmail.com 
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 -DCMAKE_INSTALL_PREFIX=/usr ..
make
sudo make install

So far, everything of my program works well.

But, if I delete the files under ~/project/build/*,
My program will come back to the last version.

Why?


Is it possible you're setting your PATH environment variable to 
include ~/project/build or something like that so by removing it the 
system is falling back on /usr/bin?


Try running which your_program_name before and after removing 
~/project/build/*.


--
Philip Lowman
Hmm, I'm sorry to trouble you here. The real problem is that I install 
it in /usr/local with careless.  So, the program linked to the libs 
under /usr/local/lib ;p


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[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/build/*,
My program will come back to the last version.

Why?


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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 used as GUI\n)
ELSE (GTK_FOUND)
PKGCONFIG(gtk+-2.0 GTK2_INCLUDE_DIR GTK2_LINK_DIR GTK2_LINK_FLAGS 
GTK2_CFLAGS)
PKGCONFIG(gthread-2.0 GTHREAD_INCLUDE_DIR GTHREAD_LINK_DIR 
GTHREAD_LINK_FLAGS+- GTHREAD_CFLAGS)

 IF (GTK2_INCLUDE_DIR)
 SET(CMAKE_C_FLAGS ${GTK2_CFLAGS} ${GTHREAD_CFLAGS})
 STRING(REGEX REPLACE -l  GTK_LIBRARIES 
${GTK2_LINK_FLAGS}  
${GTHREAD_LINK_FLAGS})

 SEPARATE_ARGUMENTS(GTK_LIBRARIES)
 ADD_DEFINITIONS(-DHAVE_GTK2)
 MESSAGE(GTK 2.x found and used as GUI\n)
 ELSE (GTK2_INCLUDE_DIR)
 MESSAGE(FATAL_ERROR GTK or GTK2 is required to build this 
project.)

 ENDIF (GTK2_INCLUDE_DIR)
ENDIF (GTK_FOUND)

ADD_EXECUTABLE(main main.c)
TARGET_LINK_LIBRARIES(main ${GTK2_LINK_FLAGS})

## Have fun!
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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, 0x080487b3 in main ()
Current language:  auto; currently asm
(gdb) n
Single stepping until exit from function main,


Does it help if you use

cmake -DCMAKE_BUILD_TYPE=Debug CMAKE_INSTALL_PREFIX=/usr ..

which actually sets the debug flag (-g) automatically?

Regards,
Werner


It works well.
Thank you for your help;p
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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

2008-12-18 Thread Kermit Mei

hello, I want debug my project which is managed by cmake.

I don't know how to add the debug information to the program.

For example, I always compile my program by the following way:


c++ -Wall -gstabs(or -g)  main.cpp hello.cpp -o main


Then I can use gdb to debug it.

How can I use cmake to do the same thing?

Thanks!
Kermit Mei

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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 you, tyler;p

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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).



It would be better to edit the CMAKE_CXX_FLAGS_DEBUG cache variable.

add_definitions(-g) is bad for a several reasons...

It will break for compilers that do not accept -g, it will add -g to 
release and optimized builds.


-Bill 

hello, I use CMAKE_CXX_FLAGS_DEBUG like this:

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, 0x080487b3 in main ()
Current language:  auto; currently asm
(gdb) n
Single stepping until exit from function main,
which has no line number information.


It is obvious that the debug information haven't been included. Why?
Is there something wrong when I use the cmake command?

Thanks.
Kermit

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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

2008-12-13 Thread Kermit Mei

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_minimum_required(VERSION 2.6)

PROJECT(MEM_BER)
SET(SRC_LIST main.cc)

MESSAGE(STATUS This is BINARY dir  ${HELLO_BINARY_DIR})
MESSAGE(STATUS This is SOURCE dir  ${HELLO_SOURCE_DIR})

INCLUDE_DIRECTORIES(/usr/include/sigc++-2.0)
INCLUDE_DIRECTORIES(/usr/lib/sigc++-2.0/include)

LINK_DIRECTORIES(/usr/lib/)

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 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_minimum_required(VERSION 2.6)

PROJECT(MEM_BER)
SET(SRC_LIST main.cc)

MESSAGE(STATUS This is BINARY dir  ${HELLO_BINARY_DIR})
MESSAGE(STATUS This is SOURCE dir  ${HELLO_SOURCE_DIR})

INCLUDE_DIRECTORIES(/usr/include/sigc++-2.0)
INCLUDE_DIRECTORIES(/usr/lib/sigc++-2.0/include)

LINK_DIRECTORIES(/usr/lib/)

ADD_EXECUTABLE(main ${SRC_LIST})

#

But I can't link the libsigc.


http://www.cmake.org/cmake/help/cmake2.6docs.html#command:target_link_libraries 



target_link_libraries(main /usr/lib/libsigc-2.0.so)
(whatever sigc library is called and where it is, don't know)

HTH,
Werner


Yes, I see. Thanks.
___
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 kermit@gmail.com 
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 uninstall. But the only thing I
can't deal
with is that I can't delete some links which point to some libraries.
My output is like this:


Have you checked to make sure you have permissions to delete the 
affected files?


What version of CMake are you using?

Have you tried this with CMake 2.6.2?

Can you create and send to the list a small example which reproduces 
the problem you're having?


--
Philip Lowman

Ok, Philip Lowman. I'd like to give you some details:


$ cmake --version
cmake version 2.6-patch 2

$ cmake -DCMAKE_INSTALL_PREFIX=~/usr ..
Everything goes well, snip the details.

$ make
Everything goes well, snip the details.

$ tree ~/usr
/home/kermit/usr [error opening dir]

0 directories, 0 files

$ make install
[ 10%] Built target FreeReciteUi
[ 90%] Built target FreeReciteCore
[100%] Built target FreeRecite-core
Install the project...
-- Install configuration: 
-- Installing: /home/kermit/usr/share/FreeRecite
-- Installing: /home/kermit/usr/share/FreeRecite/freeRecite.dict
-- Installing: /home/kermit/usr/share/FreeRecite/freeRecite.mgr
-- Installing: /home/kermit/usr/share/FreeRecite/tasks
-- Installing: /home/kermit/usr/share/FreeRecite/tasks/freeRecite.dict
-- Installing: /home/kermit/usr/bin/FreeRecite
-- Installing: /home/kermit/usr/bin/FreeRecite-core
-- Installing: /home/kermit/usr/lib/libFreeReciteCore.so.1.0
-- Installing: /home/kermit/usr/lib/libFreeReciteCore.so
-- Installing: /home/kermit/usr/lib/libFreeReciteUi.so.1.0
-- Installing: /home/kermit/usr/lib/libFreeReciteUi.so

$ tree ~/usr
/home/kermit/usr
|-- bin
|   |-- FreeRecite
|   `-- FreeRecite-core
|-- lib
|   |-- libFreeReciteCore.so - libFreeReciteCore.so.1.0
|   |-- libFreeReciteCore.so.1.0
|   |-- libFreeReciteUi.so - libFreeReciteUi.so.1.0
|   `-- libFreeReciteUi.so.1.0
`-- share
   `-- FreeRecite
   |-- freeRecite.dict
   |-- freeRecite.mgr
   `-- tasks
   `-- freeRecite.dict

5 directories, 9 files

$ make uninstall
Scanning dependencies of target uninstall
-- Uninstalling /home/kermit/usr/share/FreeRecite/freeRecite.dict
-- Uninstalling /home/kermit/usr/share/FreeRecite/freeRecite.mgr
-- Uninstalling /home/kermit/usr/share/FreeRecite/tasks/freeRecite.dict
-- Uninstalling /home/kermit/usr/bin/FreeRecite
-- Uninstalling /home/kermit/usr/bin/FreeRecite-core
-- Uninstalling /home/kermit/usr/lib/libFreeReciteCore.so.1.0
-- Uninstalling /home/kermit/usr/lib/libFreeReciteCore.so
-- File /home/kermit/usr/lib/libFreeReciteCore.so does not exist.
-- Uninstalling /home/kermit/usr/lib/libFreeReciteUi.so.1.0
-- Uninstalling /home/kermit/usr/lib/libFreeReciteUi.so
-- File /home/kermit/usr/lib/libFreeReciteUi.so does not exist.
Built target uninstall

$ tree ~/usr
/home/kermit/usr
|-- bin
|-- lib
|   |-- libFreeReciteCore.so - libFreeReciteCore.so.1.0
|   `-- libFreeReciteUi.so - libFreeReciteUi.so.1.0
`-- share
   `-- FreeRecite
   `-- tasks

5 directories, 2 files

Now, as you see, the link also exists. I can't delete it automatically.

The lib core's CMakeLists.txt I wrote like this:
SET(LIBFREERECITECORE_SRC ConfigHolder.cpp DictItem.cpp Reciter.cpp 
ForgetCurve.cpp Task.cpp Dict.cpp Manager.cpp WordList.cpp)


ADD_LIBRARY(FreeReciteCore SHARED ${LIBFREERECITECORE_SRC})

SET_TARGET_PROPERTIES(FreeReciteCore PROPERTIES VERSION 1.0 SOVERSION 1.0)
INSTALL(TARGETS FreeReciteCore LIBRARY DESTINATION lib)

Is there something wrong? And I don't know why make install will 
create the links for

the library. They do nothing for me. Can I avoid it?

Thank you, very much!





___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


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

2008-12-10 Thread Kermit Mei

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 uninstall. But the only thing I can't deal
with is that I can't delete some links which point to some libraries.
My output is like this:

$ make install
[ 10%] Built target FreeReciteUi
[ 90%] Built target FreeReciteCore
[100%] Built target FreeRecite-core
Install the project...
-- Install configuration: 
-- Installing: /home/kermit/usr/bin/FreeRecite
-- Installing: /home/kermit/usr/bin/FreeRecite-core
-- Installing: /home/kermit/usr/lib/libFreeReciteCore.so.1.0
-- Installing: /home/kermit/usr/lib/libFreeReciteCore.so
-- Installing: /home/kermit/usr/lib/libFreeReciteUi.so.1.0
-- Installing: /home/kermit/usr/lib/libFreeReciteUi.so
$ tree ~/usr
/home/kermit/usr
|-- bin
|   |-- FreeRecite
|   `-- FreeRecite-core
`-- lib
   |-- libFreeReciteCore.so - libFreeReciteCore.so.1.0
   |-- libFreeReciteCore.so.1.0
   |-- libFreeReciteUi.so - libFreeReciteUi.so.1.0
   `-- libFreeReciteUi.so.1.0

2 directories, 6 files
$ make uninstall
-- Uninstalling /home/kermit/usr/bin/FreeRecite
-- Uninstalling /home/kermit/usr/bin/FreeRecite-core
-- Uninstalling /home/kermit/usr/lib/libFreeReciteCore.so.1.0
-- Uninstalling /home/kermit/usr/lib/libFreeReciteCore.so
-- File /home/kermit/usr/lib/libFreeReciteCore.so does not exist.
-- Uninstalling /home/kermit/usr/lib/libFreeReciteUi.so.1.0
-- Uninstalling /home/kermit/usr/lib/libFreeReciteUi.so
-- File /home/kermit/usr/lib/libFreeReciteUi.so does not exist.
Built target uninstall
$ tree ~/usr
/home/kermit/usr
|-- bin
`-- lib
   |-- libFreeReciteCore.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.0
libFreeReciteUi.so
libFreeReciteUi.so.1.0
$


How can I delete the two links using make install?
Thanks!


Kermit Mei

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


[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


Their dependences is main.cpp - ui - core

What's wrong with my CMakeLists.txt so that the files under the 
directory ui can't

find the headers under the directory core.

1.ui/CMakeLists.txt :

# Make sure the compiler can find include files from our ui library.
INCLUDE_DIRECTORIES(${FREERECITE_SOURCE_DIR}/core)

# Make sure the linker can find the ui library once it is built.
LINK_DIRECTORIES(${FREERECITE_BINARY_DIR}/core)

TARGET_LINK_LIBRARIES(Cui.o core)
ADD_LIBRARY(ui Cui.cpp)



2. core/CMakeLists.txt:

# Set a variable $SRC_LIST to declare the source files.

SET(SRC_LIST ConfigHolder.cpp DictItem.cpp Reciter.cpp ForgetCurve.cpp 
Task.cpp Dict.cpp Manager.cpp WordList.cpp)



# Create a library called Core which includes the source files.
# The extension is already found. Any number of sources could be listed 
here.


ADD_LIBRARY(core ${SRC_LIST})

Thanks.
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake