-
Notifications
You must be signed in to change notification settings - Fork 25
Description
We have found that during the cmake stage itself all the header files of tdi and its third-party are copied to ${CMAKE_INSTALL_PREFIX}/include/
Few instances here:
https://github.com/p4lang/tdi/blob/22cb07ac887491450d2efdb65cca727f99ecd317/CMakeLists.txt#L15C1-L17C26
https://github.com/p4lang/target-utils/blob/455fc4787a199978e0ae53bd2a6eb0cd2af1b790/CMakeLists.txt#L54
Also during make, libraries are copied to ${CMAKE_INSTALL_PREFIX}/lib. Such as below:
├── libcjson.a
├── libclish.so
├── libtarget_sys.so
├── libtarget_utils.so
├── libtdi_json_parser.so
├── libtdi_pna.so
├── libtdi_psa.so
├── libtdi.so
└── libtdi_tna.so
Is this a standard practice?
From a usability point, these are the following customer requirements we are not able to meet (because of it):
- until make install is called the customer wants ${CMAKE_INSTALL_PREFIX} to be untouched.
- make uninstall should clean any file copied or created in ${CMAKE_INSTALL_PREFIX}
Probable alternative:
Copy all the libs/artifacts to ${CMAKE_BINARY_DIR} so that we can internally include/link and proceed with the build.
Only "make install" should ideally copy the artifacts.
In this way we can reverse everything done by make install by using make uninstall.