I am new to CMake and have been trying to structure my project so that I build a shared library (game engine) that can then be linked to one or more executables (games). My directory structure is as follows:
- build
- engine
- - include
- - source
- game
- - include
- - source
- resources
- scripts
I have managed to install the shared library with the command:
install(TARGETS Engine
EXPORT Engine
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
install(EXPORT Engine DESTINATION lib)
This creates the following file: build/engine/CMakeFiles/Export/lib/Engine.cmake
How can I include this file so that I can link my Engine library with my Game executable?
I had hoped that it was just a case of using find_package(Engine REQUIRED)
.