Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMake build script for PKCS#11 #8

Open
gl-mc opened this issue Nov 18, 2021 · 0 comments
Open

Add CMake build script for PKCS#11 #8

gl-mc opened this issue Nov 18, 2021 · 0 comments

Comments

@gl-mc
Copy link

gl-mc commented Nov 18, 2021

Many IDEs support CMake (CLion has it as a default, and integration in Visual Studio Code is also very good). It would be great if the PKCS11 consortium published a CMake module that helps developers getting started with PKCS#11 development in their IDE.

I have attached such a module for reference FindPKCS11.cmake.zip. I had to zip it because GitHub did not accept files ending in .cmake.

To use it, you would check out the oasis-tcs/pkcs11 project as a git submodule into your projects source folder.

The attached module FindPKCS11.cmake.zip can then be used by adding the following two lines to your CMakeLists.txt (assuming it resides in your ${PROJECT_SOURCE_DIR}/cmake folder):

list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(PKCS11 2.40.0)

Then add it to your targets that need linking against PKCS#11 as follows:

target_link_libraries(<target_name> PRIVATE PKCS11::PKCS11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant