简体   繁体   中英

Detect if files are overridden in the installation directory

I'm configuring a CMake project from source and build and install it with make , ie,

$ ls
./build/  ./source/
$ cd build/
$ cmake ../source/
[...]
$ make
[...]
$ make install
[...]

I noticed now that the project is badly configured in that it contains numerous files with the same name that get overridden in the installation directory, eg, /usr/local/include/mystring.h gets written to more than once by make install .

Is there a systematic way to detect if files are overridden within the same project?

Well, you can wrap install() calls into your own function, which would store all installed files in cache list variable and check for existing item before actually call install() .

You may also check ${PROJECT_BINARY_DIR}/install_manifest.txt file - maybe it would contain duplicates in your case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM