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

Kermit Mei kermit.mei at gmail.com
Mon Jan 19 03:24:40 EST 2009


Philip Lowman wrote:
> On Mon, Jan 19, 2009 at 1:59 AM, Kermit Mei <kermit.mei at gmail.com 
> <mailto:kermit.mei at 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?





More information about the CMake mailing list