Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CEPCSW
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Li Zhihao
CEPCSW
Commits
f37be999
Commit
f37be999
authored
4 years ago
by
lintao@ihep.ac.cn
Browse files
Options
Downloads
Patches
Plain Diff
WIP: add FindGenFit.
parent
79fc7481
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/FindGenFit.cmake
+55
-0
55 additions, 0 deletions
cmake/FindGenFit.cmake
with
55 additions
and
0 deletions
cmake/FindGenFit.cmake
0 → 100644
+
55
−
0
View file @
f37be999
# - Try to find GenFit
# Defines:
#
# GenFit_FOUND
# GenFit_INCLUDE_DIRS
# GenFit_LIBRARIES
#
# Imports:
#
# GenFit::genfit2
#
# Usage of the target instead of the variables is advised
# Find quietly if already found before
if
(
DEFINED CACHE{GenFit_INCLUDE_DIRS}
)
set
(
${
CMAKE_FIND_PACKAGE_NAME
}
_FIND_QUIETLY YES
)
endif
()
find_path
(
GenFit_INCLUDE_DIRS NAMES GFGbl.h
HINTS
${
GENFIT_ROOT_DIR
}
/include $ENV{GENFIT_ROOT_DIR}/include
${
GenFit_DIR
}
/include $ENV{GenFit_DIR}/include
${
CMAKE_PREFIX_PATH
}
/include
)
find_library
(
GenFit_LIBRARIES NAMES genfit2
HINTS $ENV{GENFIT_ROOT_DIR}/lib
${
GENFIT_ROOT_DIR
}
/lib
${
GenFit_DIR
}
/lib
${
GenFit_DIR
}
/lib64
$ENV{GenFit_DIR}/lib $ENV{GenFit_DIR}/lib64
${
CMAKE_PREFIX_PATH
}
/lib
${
CMAKE_PREFIX_PATH
}
/lib64
)
# handle the QUIETLY and REQUIRED arguments and set GENFIT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE
(
FindPackageHandleStandardArgs
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
GenFit DEFAULT_MSG GenFit_INCLUDE_DIRS GenFit_LIBRARIES
)
mark_as_advanced
(
GenFit_FOUND GenFit_INCLUDE_DIRS GenFit_LIBRARIES
)
# Modernisation: create an interface target to link against
if
(
TARGET GenFit::genfit2
)
return
()
endif
()
if
(
GenFit_FOUND
)
add_library
(
GenFit::genfit2 IMPORTED INTERFACE
)
target_include_directories
(
GenFit::genfit2 SYSTEM INTERFACE
"
${
GenFit_INCLUDE_DIRS
}
"
)
target_link_libraries
(
GenFit::genfit2 INTERFACE
"
${
GenFit_LIBRARIES
}
"
)
# Display the imported target for the user to know
if
(
NOT
${
CMAKE_FIND_PACKAGE_NAME
}
_FIND_QUIETLY
)
message
(
STATUS
" Import target: GenFit::genfit2"
)
endif
()
endif
()
if
(
COMMAND __deprecate_var_for_target
)
variable_watch
(
GenFit_INCLUDE_DIRS __deprecate_var_for_target
)
endif
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment