-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support component-based
find_package
(#756)
Signed-off-by: Juan Cruz Viotti <[email protected]>
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,27 @@ | ||
@PACKAGE_INIT@ | ||
|
||
# Support both casing styles | ||
list(APPEND JSONBINPACK_COMPONENTS ${JSONBinPack_FIND_COMPONENTS}) | ||
list(APPEND JSONBINPACK_COMPONENTS ${jsonbinpack_FIND_COMPONENTS}) | ||
if(NOT JSONBINPACK_COMPONENTS) | ||
list(APPEND JSONBINPACK_COMPONENTS runtime) | ||
list(APPEND JSONBINPACK_COMPONENTS compiler) | ||
endif() | ||
|
||
include(CMakeFindDependencyMacro) | ||
find_dependency(JSONToolkit COMPONENTS uri json jsonpointer jsonschema) | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsonbinpack_runtime.cmake") | ||
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsonbinpack_compiler.cmake") | ||
|
||
foreach(component ${JSONBINPACK_COMPONENTS}) | ||
if(component STREQUAL "runtime") | ||
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsonbinpack_runtime.cmake") | ||
elseif(component STREQUAL "compiler") | ||
include("${CMAKE_CURRENT_LIST_DIR}/sourcemeta_jsonbinpack_compiler.cmake") | ||
else() | ||
message(FATAL_ERROR "Unknown JSON BinPack component: ${component}") | ||
endif() | ||
endforeach() | ||
|
||
check_required_components("@PROJECT_NAME@") |