Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TEC Server Config
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container 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
MSK-SW
Infrastructure and Support
TEC
TEC Server Config
Commits
cb89524b
Commit
cb89524b
authored
8 years ago
by
Martin Christoph Hierholzer
Browse files
Options
Downloads
Patches
Plain Diff
added add_dependency macro
parent
69ed1262
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/add_dependency.cmake
+39
-0
39 additions, 0 deletions
cmake/add_dependency.cmake
with
39 additions
and
0 deletions
cmake/add_dependency.cmake
0 → 100644
+
39
−
0
View file @
cb89524b
#######################################################################################################################
# add_dependency.cmake
#
# Define macro to search for a dependency and add it to our project. This works only with dependency using the
# project-template!
#
# The macro is called "add_dependency" and takes 3 arguments:
# - name of the dependency project as passed to FIND_PACKAGE (e.g. "mtca4u-deviceaccess")
# - required version as passed to FIND_PACKAGE
# - a list of components used by this project including the REQUIRED keyword etc.
#
# The macro will call FIND_PACKAGE, add the returned include directories to the system list, add the library directories
# to the list of link directories, and update the CMAKE_CXX_FLAGS and the PACKAGE_DEPENDENCY_VERSIONS variables.
#
#######################################################################################################################
#######################################################################################################################
#
# IMPORTANT NOTE:
#
# DO NOT MODIFY THIS FILE inside a project. Instead update the project-template repository and pull the change from
# there. Make sure to keep the file generic, since it will be used by other projects, too.
#
# If you have modified this file inside a project despite this warning, make sure to cherry-pick all your changes
# into the project-template repository immediately.
#
#######################################################################################################################
MACRO
(
add_dependency dependency_project_name required_version components
)
FIND_PACKAGE
(
${
dependency_project_name
}
${
required_version
}
COMPONENTS
${
components
}
)
include_directories
(
SYSTEM
${${
dependency_project_name
}
_INCLUDE_DIRS
}
)
link_directories
(
${${
dependency_project_name
}
_LIBRARY_DIRS
}
)
SET
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
${${
dependency_project_name
}
_CXX_FLAGS
}
"
)
set
(
PACKAGE_DEPENDENCY_VERSIONS
"
${
PACKAGE_DEPENDENCY_VERSIONS
}
${
dependency_project_name
}
-
${${
dependency_project_name
}
_VERSION
}
"
)
ENDMACRO
(
add_dependency
)
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