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

Disabling BUILD_RTTR_DYNAMIC causes error on generating project files #248

Open
spicyPoke opened this issue Jul 23, 2019 · 1 comment
Open

Comments

@spicyPoke
Copy link

Hello,
When I try to disable BUILD_RTTR_DYNAMIC option on cmake generator, it emits a lot of errors about missing target as follows

CMake Error at src/unit_tests/CMakeLists.txt:47 (add_executable):
  Target "unit_tests" links to target "RTTR::Core" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at src/examples/json_serialization/CMakeLists.txt:42 (add_executable):
  Target "json_example" links to target "RTTR::Core" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at src/examples/library_loading/library_loader_example/CMakeLists.txt:42 (add_executable):
  Target "library_loader_example" links to target "RTTR::Core" but the target
  was not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?

CMake Error at src/examples/scripting/CMakeLists.txt:42 (add_executable):
  Target "scripting_example" links to target "RTTR::Core" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?

CMake Error at src/unit_tests/CMakeLists.txt:49 (add_dependencies):
  The dependency target "RTTR::Core" of target "unit_tests" does not exist.

CMake Error at src/examples/json_serialization/CMakeLists.txt:42 (add_executable):
  Target "json_example" links to target "RTTR::Core" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at src/unit_tests/base_library/CMakeLists.txt:45 (add_library):
  Target "unit_test_base" links to target "RTTR::Core" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?

CMake Error at src/unit_tests/plugin/CMakeLists.txt:45 (add_library):
  Target "unit_test_plugin" links to target "RTTR::Core" but the target was
  not found.  Perhaps a find_package() call is missing for an IMPORTED
  target, or an ALIAS target is missing?

I figure that's because there's no link to RTTR::Core_Lib_STL in those projects.
Is there a reason for the missing link?

I've also submitted a PR that disables Benchmarks, Unit Tests, and Examples if the user disables BUILD_RTTR_DYNAMIC, you might want to take a look.
Fix disabling dynamic/shared version of RTTR #247

@rbeard47
Copy link

rbeard47 commented Oct 1, 2019

I believe this is a because of how the example projects are built. I built them with the static library, but had to update the CMakeLists.txt for each project. I think the better route would be to update the unit tests, examples, etc to include the correct library in the target_link_libraries section based on the options

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