Skip to content

Build artifacts and include files are copied during cmake and make #129

@shibir007

Description

@shibir007

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

  1. until make install is called the customer wants ${CMAKE_INSTALL_PREFIX} to be untouched.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions