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 samples to CMake build #42

Merged
merged 3 commits into from
Jan 17, 2022
Merged

Add samples to CMake build #42

merged 3 commits into from
Jan 17, 2022

Conversation

rotolof
Copy link
Contributor

@rotolof rotolof commented Jan 17, 2022

This will add the examples to the CMake build.

mkdir build && cd build
cmake ..
# This will build everything
make
# This will build only the library
make JetsonGPIO
# This will build the examples
make examples
  • Examples will be configured/built unless -DBUILD_EXAMPLES=OFF is passed to cmake.
    We can choose to enforce the opposite behavior by putting this instead:

    option(BUILD_EXAMPLES "Build examples" OFF)

    So examples will be configured /built only if we pass -DBUILD_EXAMPLES=ON to cmake.

  • I didn't add samples/test_all_apis.cpp to the examples since it's already there as a test.

  • At the moment, the generated binaries will not be installed.

@pjueon
Copy link
Owner

pjueon commented Jan 17, 2022

Thank you very much.
For the default value of BUILD_EXAMPLES, I prefer OFF.
I set it to OFF and updated the README file.

@pjueon pjueon self-requested a review January 17, 2022 17:14
@pjueon pjueon merged commit abba3cf into pjueon:master Jan 17, 2022
@rotolof rotolof deleted the examples_cmake branch January 18, 2022 12:04
@pjueon pjueon added the enhancement New feature or request label Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants