Skip to content
Snippets Groups Projects
Commit 7d85edc8 authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

chore(project-template): warn about add_dependency use

parent 26978992
No related branches found
No related tags found
1 merge request!3update project template
...@@ -54,7 +54,7 @@ FUNCTION(add_dependency dependency_project_name required_version) ...@@ -54,7 +54,7 @@ FUNCTION(add_dependency dependency_project_name required_version)
ENDFUNCTION(add_dependency) ENDFUNCTION(add_dependency)
# make sure that cmake finds modules provided by project-template. # make sure that cmake finds modules provided by project-template.
# since with new cmake concept for imported targets, dependencies also search for implicit dependencies, # since with new cmake concept for imported targets, dependencies also search for implicit dependencies,
# all projects using add_dependency also require this module path. # all projects using add_dependency also require this module path.
set(_projectTemplateModulePath ${CMAKE_SOURCE_DIR}/cmake/Modules) set(_projectTemplateModulePath ${CMAKE_SOURCE_DIR}/cmake/Modules)
# substr search is better than regex if paths have special characters # substr search is better than regex if paths have special characters
...@@ -62,3 +62,11 @@ string(FIND ":${CMAKE_MODULE_PATH}:" ":${_projectTemplateModulePath}:" _projectT ...@@ -62,3 +62,11 @@ string(FIND ":${CMAKE_MODULE_PATH}:" ":${_projectTemplateModulePath}:" _projectT
if (${_projectTemplateModulePathPos} EQUAL -1) if (${_projectTemplateModulePathPos} EQUAL -1)
list(APPEND CMAKE_MODULE_PATH "${_projectTemplateModulePath}") list(APPEND CMAKE_MODULE_PATH "${_projectTemplateModulePath}")
endif() endif()
message(WARNING "
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
You are using add_dependency() in your CMakeLists.txt which is deprecated and may lead to subtle problems. Please follow the project-template migration guide to cmake imported targets.
Furhter processing is delayed by 5 seconds.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
")
execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5.0)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment