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

Allow using library as a local dependency #60

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

Conversation

TheLartians
Copy link

@TheLartians TheLartians commented Jan 26, 2021

Hey, thanks for this great library!

I've had some trouble integrating it into a larger project, as the install package was disabled and the -WError flag set in the original CMakeLists prevented me from building it due to an unused function.

This PR cleans up the CMakeLists and isolates the tests and warnings from the main project. Additionally, it uses PackageProject.cmake to create a proper installable target without much boilerplate. Tests now run in GitHub workflows (Unix, Mac and Windows) and the install itself is tested as well. To build and run the tests, you can now use the tests subdirectory directly.

cmake -Stest -Bbuild
cmake --build build
cmake --build build --target test

The changes now allow easy integration into external projects. E.g. you can now easily use my fork of CrossGuid through the CPM.cmake package manager:

CPMaddPackage(
  NAME CrossGuid
  GITHUB_REPOSITORY TheLartians/crossguid
  VERSION 0.3.0-pre-release
  GIT_TAG 0b3850edc49ecb7641ba4daace09399dd60813b5
)

target_link_libraries(myLibrary PRIVATE CrossGuid::CrossGuid) 

Let me know if these changes are interesting for you, then I could also update the Readme and add additional tests for iOS and Android.

Fixes #48

@marton78
Copy link

This is a great PR @graeme-hill, are you planning to merge it?

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.

Using -Werror on OSX causes compilation error
2 participants