intel / intel-ipsec-mb

Intel(R) Multi-Buffer Crypto for IPSec
BSD 3-Clause "New" or "Revised" License
288 stars 88 forks source link

Make CMake builds behave more "normal" #141

Closed Thomas1664 closed 4 months ago

Thomas1664 commented 6 months ago

I noticed the following issues while updating the intel-ipsec port in vcpkg ( https://github.com/microsoft/vcpkg/pull/36066 ):

On Windows, the DLL is copied to System32. This not only requires admin privileges but is also completely unnecessary. Also on Windows, the structure of the installed files is completely different from the common directory layout (i.e. headers into ${PREFIX}/include, static libraries into ${PREFIX}/lib, and shared libraries into ${PREFIX}/bin). Everything is installed together in one directory. As a result, we have to move all files to their expected locations.

Additionally, it would be nice if you provided CMake config files. This would make it easier for users to consume this library and would also remove the need to copy the dll to System32 in order to be found because CMake takes care of that.

We have a policy to not build examples, tests, or documentation. It would be nice if you can provide an option to not build them.

mdcornu commented 6 months ago

Thanks for your feedback, our CMake build is currently still in the experimental stage so all feedback is appreciated. I'm not too familiar with Windows packaging or what is considered standard installation directories on Windows (e.g. what should be the default ${PREFIX}?). If you have references / examples of how this should be done that would be very useful.

We are also happy to accept contributions, so feel free to submit a PR with any improvements.

Is vcpkg building with mingw?

Thomas1664 commented 5 months ago

I'm not too familiar with Windows packaging or what is considered standard installation directories on Windows (e.g. what should be the default ${PREFIX}?). If you have references / examples of how this should be done that would be very useful.

You're probably thinking too much about that. Usually, ${PREFIX} is provided by the consumer of a package. You can follow this guide for more information on how to export CMake targets.

Is vcpkg building with mingw?

Vcpkg can build packages for mingw, but building packages for mingw is not tested in their CI.

MonicaLiu0311 commented 4 months ago

Is there any progress?

mdcornu commented 4 months ago

I will add this work to our backlog and we can try to look into it if time permits. For clarification on the installation path issue, the suggested directory structure should look like below?

${PREFIX}/intel-ipsec-mb/
├── bin
│   ├── libIPSec_MB.dll
│   ├── libIPSec_MB.exp
│   ├── libIPSec_MB.pdb
│   └── libIPSec_MB_lnk.def
├── include
│   └── intel-ipsec-mb.h
└── lib
    └── libIPSec_MB.lib
Thomas1664 commented 4 months ago

For clarification on the installation path issue, the suggested directory structure should look like below?

Yes.

mdcornu commented 4 months ago

For clarification on the installation path issue, the suggested directory structure should look like below?

Yes.

OK, thanks for the information. I'll close this issue for now and we will try to add these suggestions before the next release if possible. As mentioned previously, contributions are always welcome too🙂 Please re-open the issue if needed.