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

Build mbedcrypto from other directory than mbedcrypto root dir. #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kapstok
Copy link
Contributor

@kapstok kapstok commented Feb 10, 2018

Made some changes in CMake to make the mbedcrypto library also 'buildable' from a different directory than the mbedcrypto root directory. This is useful when a CMake project, say Project A, uses the library.

Project A has the mbedcrypto repo as a submodule in the directory ProjectA/dep/mbedcrypto.

The developer of Project A can add the library simply by adding this code to ProjectA/CMakeLists.txt:

file (GLOB MBEDCRYPTO "dep/mbedcrypto")
add_subdirectory(${MBEDCRYPTO})
target_link_libraries (ProjectA mbedcrypto)

From that point the library is linked to Project A.
The library can still be tested with mbedcrypto_tests. After calling cmake and make from the (unix) Terminal, the developer can test the library by executing:

dep/mbedcrypto.xbin64/mbedcrypto_tests

The statement is executed from the CMAKE_BINARY_DIRECTORY.

If this pull request will be approved, I'm also planning to add a wiki page to the repo that describes how to link the mbedcrypto library to your own project as developer.

@azadkuh
Copy link
Owner

azadkuh commented Feb 13, 2018

@kapstok
sorry i'm so busy this week, let me check it at weekend.

@kapstok
Copy link
Contributor Author

kapstok commented Feb 13, 2018

Not a problem. I'll see a response when you have enough time :)

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

Successfully merging this pull request may close these issues.

None yet

2 participants