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 tests fails when included in another project with CMake FetchContent #7

Open
craigpepper opened this issue Sep 26, 2023 · 1 comment

Comments

@craigpepper
Copy link

When logfault is included in another project via CMake FetchContent, compilation of general_tests.cpp fails with logfault.h not found

FetchContent_Declare(
    logfault
    GIT_REPOSITORY https://github.com/jgaa/logfault
)
FetchContent_MakeAvailable(logfault)
target_link_libraries( myProgram PRIVATE logfault )

This is due to the include_directories statement using CMAKE_SOURCE_DIR rather than PROJECT_SOURCE_DIR

It would also be desirable to add a CMake option to omit building tests.

craigpepper pushed a commit to craigpepper/logfault that referenced this issue Sep 26, 2023
…roject. Also add option to turn off build tests
jgaa added a commit that referenced this issue Sep 29, 2023
Fix Issue #7 - tests compilation fails when included in another project. Also add option to turn off build tests
@jgaa
Copy link
Owner

jgaa commented Sep 29, 2023

@craigpepper I merged your PR for this. Thank you!

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

2 participants