-
Notifications
You must be signed in to change notification settings - Fork 654
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improvements to make SPARTA easier to use as a dependency
Summary: This PR includes some improvements to the CMake configuration that makes SPARTA easier to use as a dependency (or at least I've found these useful for a project I'm working on). Specifically: * Generate a `sparta-config.cmake` file that is created in both the build folder and for the install target. This enables the library to be used with `find_package`. * (Breaking change) Install the `sparta_target.cmake` to `$LIBDIR/cmake/sparta` instead of `$PREFIX/cmake` to support \*nix systems as well as `find_package`. While this is a breaking change, it's unlikely that anyone used the installed file due to the bugs observed in facebook/SPARTA#23. * (Breaking change) Use `sparta::` as the target namespace when exporting the `sparta` target. Projects that previously included the `sparta_target.cmake` will need to be updated to use `sparta::sparta` instead of `sparta` when specifying it as a dependency. * Update the README with additional tips on how to use SPARTA in CMake projects. This PR is stacked on top of facebook/SPARTA#23, and I'll rebase after it is merged. X-link: facebook/SPARTA#24 Reviewed By: arnaudvenet Differential Revision: D52238117 Pulled By: arthaud fbshipit-source-id: abfad1312d5357a5adc64335d7a51e80935cf111
- Loading branch information
1 parent
b309244
commit b39fdf5
Showing
5 changed files
with
70 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
@PACKAGE_INIT@ | ||
|
||
include(CMakeFindDependencyMacro) | ||
find_dependency(Boost COMPONENTS thread) | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/sparta_target.cmake") |