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 option for disabling testing & examples #54

Closed
feliwir opened this issue Apr 3, 2017 · 3 comments
Closed

Add cmake option for disabling testing & examples #54

feliwir opened this issue Apr 3, 2017 · 3 comments
Assignees

Comments

@feliwir
Copy link

feliwir commented Apr 3, 2017

Hello,
I am using PEGTL as a submodule for my own repository and link it by using "cmake_add_subdirectroy" (which works perfectly fine). The annoying part is that this will add all of the PEGL examples & tests to my own project. Currently there is no cmake option to disable this. I'd recommend something like this:
option(BUILD_TESTS "Wether or not to build PEGL test cases" TRUE),
which would build the tests if not explicitly disabled before.

@d-frey
Copy link
Member

d-frey commented Apr 3, 2017

I added two options, one for tests, one for the examples. Please see if it works for you and solves your issue, re-open when necessary.

Also, since this is the first time I'm working with CMake, please point out anything that you feel could be improved. Thanks. :)

@feliwir
Copy link
Author

feliwir commented Apr 4, 2017

Yep this is exactly what i was looking. Maybe I'd prefix the options with PEGTL_ (= PEGTL_BUILD_EXAMPLES etc.), so there is no conflict with variables from other cmake projects. For example it is done like this in GLFW: http://www.glfw.org/docs/latest/build_guide.html#build_link_cmake_source

Thanks for your fix 👍

@d-frey
Copy link
Member

d-frey commented Apr 4, 2017

Good idea, I've added the prefixes. Thanks.

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

No branches or pull requests

3 participants