jkuhlmann / gainput

Cross-platform C++ input library supporting gamepads, keyboard, mouse, touch
http://gainput.johanneskuhlmann.de/
MIT License
858 stars 103 forks source link

Cannot specify link libraries for target "gainput" which is not built by this project. #78

Open jpvanoosten opened 4 years ago

jpvanoosten commented 4 years ago

Surprising that I haven't seen this issue reported yet, but if I disable "GAIN_BUILD_SHARED" I get the following error when trying to configure the project with CMake:

CMake Error at lib/CMakeLists.txt:40 (target_link_libraries):
  Cannot specify link libraries for target "gainput" which is not built by
  this project.

Which makes sense since the "gainput" target shouldn't be created if "GAIN_BUILD_SHARED" is disabled.

Similarly, if I disable "GAIN_BUILD_STATIC" I get the following error when trying to configure the project with CMake:

CMake Error at lib/CMakeLists.txt:41 (target_link_libraries):
  Cannot specify link libraries for target "gainputstatic" which is not built
  by this project.

Which also makes sense because the "gainputstatic" target shouldn't be created if "GAIN_BUILD_SHARED" is disabled!

jpvanoosten commented 4 years ago

This is solved in a pull request: #79