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

Document how to use beman projects using CMake FetchContent workflows #8

Closed
frankmiller opened this issue May 2, 2024 · 4 comments
Closed

Comments

@frankmiller
Copy link
Contributor

No description provided.

@frankmiller
Copy link
Contributor Author

I created a new project that uses cmake FetchContent to build the beman example project and link it into an executable.

CMakeLists.txt

cmake_minimum_required(VERSION 3.27.6)
project(use_beman_example LANGUAGES CXX)

include(FetchContent)
FetchContent_Declare(
  example
  GIT_REPOSITORY https://github.com/beman-org/example.git
  GIT_TAG        3f56ffded19291656e6f8cc708c9297f86d7c6cb
)
FetchContent_MakeAvailable(example)

add_executable(use_beman_example main.cpp)
target_link_libraries(use_beman_example PRIVATE example)

main.cpp

#include <iostream>
#include <example.hxx>

int main()
{
  std::cout << "hello beman!\n";
}

@neatudarius
Copy link
Member

neatudarius commented Jul 25, 2024

@frankmiller , can you check #27 ? If you'll add something into docs, please sync with examples from Beman Standard (or update them if required). Thanks!

@ClausKlein
Copy link

If a library is used as a subproject no test an no example must be compiled!

You need an individual library_name_build_tests option ...

@neatudarius
Copy link
Member

I think was completed via #75

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

3 participants