jrouwe / JoltPhysics

A multi core friendly rigid body physics and collision detection library. Written in C++. Suitable for games and VR applications. Used by Horizon Forbidden West.
MIT License
6k stars 374 forks source link

Generate a CMake config file when the project is installed #1140

Closed JimmyCabbage closed 1 month ago

JimmyCabbage commented 1 month ago

I noticed that Jolt only installs its header files and its library file, and that it was lacking a config file for find_package() to work automatically.

This commit adds an export() and install(EXPORT) command in CMakeLists.txt so that one is automatically generated when Jolt is built, and automatically installed when Jolt is installed.

This allows for other CMake projects to do something like:

find_package(Jolt)

# snip

add_executable(Generic main.cpp)
target_link_libraries(Generic PRIVATE Jolt::Jolt)
CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

jrouwe commented 1 month ago

Thanks, I did not know that this existed!

baszalmstra commented 6 days ago

Would you perhaps be able to cut a new release that includes these changes?

jrouwe commented 4 days ago

I was planning to create a new release somewhere in the first half of August