Discussion:
[CMake] How to deal with "make uninstall" ?
Group
2008-12-07 07:13:16 UTC
Permalink
Hello, I'm a newbie of cmake. In a simple project, I worte the
CMakelists.txt file like this:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cmake_minimum_required(VERSION 2.6)
PROJECT(FREERECITE)

ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(dict)

INSTALL(FILES ../bin/FreeRecite-core DESTINATION bin)
INSTALL(FILES COPYRIGHT README DESTINATION share/doc/FreeRecite)
INSTALL(DIRECTORY dict/ DESTINATION share)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

When I use "make install", everything do as I wanted.
But I can't use "make uninstall". How to deal with it?

And I hope you can give me more links about cmake tutorial.
Thanks.

Kermit
Óscar Fuentes
2008-12-07 12:21:44 UTC
Permalink
Group <***@gmail.com> writes:

[snip]
Post by Group
When I use "make install", everything do as I wanted.
But I can't use "make uninstall". How to deal with it?
http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
Post by Group
And I hope you can give me more links about cmake tutorial.
http://www.cmake.org/Wiki/CMake#Tutorials
--
Oscar
Group
2008-12-08 06:24:31 UTC
Permalink
Post by Óscar Fuentes
[snip]
Post by Group
When I use "make install", everything do as I wanted.
But I can't use "make uninstall". How to deal with it?
http://www.cmake.org/Wiki/CMake_FAQ#Can_I_do_.22make_uninstall.22_with_CMake.3F
Post by Group
And I hope you can give me more links about cmake tutorial.
http://www.cmake.org/Wiki/CMake#Tutorials
Okay, Thank you, very much!
Kermit Mei
2008-12-10 19:13:31 UTC
Permalink
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
Philip Lowman
2008-12-12 05:25:23 UTC
Permalink
Post by Óscar Fuentes
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.
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
Kermit Mei
2008-12-12 09:34:35 UTC
Permalink
Post by Óscar Fuentes
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.
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!

Continue reading on narkive:
Loading...