-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from traversaro/vcpkgvisitstruct
Support finding visit_struct in the system also if it is installed without any CMake config file
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
# - Try to find visit_struct | ||
# | ||
# The following are set after configuration is done: | ||
# visit_struct_FOUND | ||
# | ||
# The following imported targets are created: | ||
# | ||
# visit_struct::visit_struct | ||
# | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package(visit_struct CONFIG QUIET) | ||
|
||
if(NOT visit_struct_FOUND) | ||
find_path(VISIT_STRUCT_INCLUDE_DIR visit_struct/visit_struct_intrusive.hpp) | ||
mark_as_advanced(VISIT_STRUCT_INCLUDE_DIR) | ||
|
||
if(VISIT_STRUCT_INCLUDE_DIR) | ||
set(visit_struct_FOUND TRUE) | ||
endif() | ||
endif() | ||
|
||
find_package_handle_standard_args(visit_struct DEFAULT_MSG visit_struct_FOUND) | ||
|
||
if(visit_struct_FOUND) | ||
if(NOT TARGET visit_struct::visit_struct) | ||
add_library(visit_struct::visit_struct INTERFACE IMPORTED) | ||
set_target_properties(visit_struct::visit_struct PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${VISIT_STRUCT_INCLUDE_DIR}") | ||
endif() | ||
endif() |