Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CTA-LAPP
PHOENIX_LIBS
PhoenixBinaryAnalyzer
Commits
09b1a326
Commit
09b1a326
authored
Jun 30, 2021
by
Pierre Aubert
Browse files
Add the ability to choose the tag or branch to be used when pulling a Phoenix project dependencies
parent
149d5a26
Pipeline
#126413
passed with stages
in 1 minute and 9 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
5 deletions
+26
-5
cmake/pull_extra_module.cmake
cmake/pull_extra_module.cmake
+11
-5
cmake/scriptCloneModule.sh
cmake/scriptCloneModule.sh
+8
-0
cmake/scriptPull.sh
cmake/scriptPull.sh
+7
-0
No files found.
cmake/pull_extra_module.cmake
View file @
09b1a326
...
...
@@ -9,9 +9,14 @@ set(SCRIPT_CLONE_PACKAGE "${CMAKE_CURRENT_SOURCE_DIR}/scriptClonePackage.sh" CAC
# Parameter :
# packageName : name of the package to be found (classic parameter of find_package)
# urlGitToPackage : url of the git repository to be used to fetch it if it is not found
# ARGN : optional branch name or tag name to be used
function
(
get_extra_module packageName urlGitToPackage
)
set
(
PHOENIX_TARGET_NAME
"phoenix_
${
packageName
}
_found"
)
if
(
PHOENIX_TAG
)
set
(
SPECIFIC_BRANCH
${
PHOENIX_TAG
}
)
else
()
set
(
SPECIFIC_BRANCH
${
ARGN
}
)
endif
()
if
(
TARGET
${
PHOENIX_TARGET_NAME
}
)
message
(
STATUS
"Project
${
packageName
}
already found, target
${
PHOENIX_TARGET_NAME
}
exits"
)
else
()
...
...
@@ -23,7 +28,7 @@ function(get_extra_module packageName urlGitToPackage)
if
(
EXISTS
${
MODULE_PROJECT_DIR
}
)
message
(
STATUS
"Find project
${
packageName
}
in
${
MODULE_PROJECT_DIR
}
"
)
execute_process
(
COMMAND
${
SCRIPT_PULL_MODULE
}
${
MODULE_PROJECT_DIR
}
execute_process
(
COMMAND
${
SCRIPT_PULL_MODULE
}
${
MODULE_PROJECT_DIR
}
${
SPECIFIC_BRANCH
}
WORKING_DIRECTORY
${
SUB_MODULE_DIRECTORY
}
/
ERROR_QUIET
OUTPUT_QUIET
...
...
@@ -36,7 +41,7 @@ function(get_extra_module packageName urlGitToPackage)
if
(
urlGitToPackage
)
get_filename_component
(
basePackageDirName
${
urlGitToPackage
}
NAME_WE
)
message
(
STATUS
"Get project
${
packageName
}
with url '
${
urlGitToPackage
}
'"
)
execute_process
(
COMMAND
${
SCRIPT_CLONE_MODULE
}
${
urlGitToPackage
}
execute_process
(
COMMAND
${
SCRIPT_CLONE_MODULE
}
${
urlGitToPackage
}
${
SPECIFIC_BRANCH
}
WORKING_DIRECTORY
${
SUB_MODULE_DIRECTORY
}
/
)
if
(
EXISTS
${
MODULE_PROJECT_DIR
}
)
message
(
STATUS
"Find project
${
packageName
}
in
${
MODULE_PROJECT_DIR
}
"
)
...
...
@@ -59,6 +64,7 @@ endfunction(get_extra_module)
# Parameter :
# packageName : name of the package to be found (classic parameter of find_package)
# urlGitToPackage : url of the git repository to be used to fetch it if it is not found
# ARGN : optional branch name or tag name to be used
function
(
pull_extra_module packageName urlGitToPackage
)
# There is one global varialbe PHOENIX_FORCE_PULL_MODULE
# - if the PHOENIX_FORCE_PULL_MODULE == no
...
...
@@ -73,7 +79,7 @@ function(pull_extra_module packageName urlGitToPackage)
# - if the module is found, we pull it even if the package does exist (we recompile it and reinstall it)
if
(
PHOENIX_FORCE_PULL_MODULE
)
# We always pull the module
get_extra_module
(
${
packageName
}
${
urlGitToPackage
}
)
get_extra_module
(
${
packageName
}
${
urlGitToPackage
}
${
ARGN
}
)
else
()
# Try to find the package
find_package
(
${
packageName
}
QUIET
)
...
...
@@ -88,7 +94,7 @@ function(pull_extra_module packageName urlGitToPackage)
else
()
# The module is not found, so we get it
message
(
STATUS
"
${
packageName
}
not found"
)
get_extra_module
(
${
packageName
}
${
urlGitToPackage
}
)
get_extra_module
(
${
packageName
}
${
urlGitToPackage
}
${
ARGN
}
)
endif
()
endif
()
endfunction
(
pull_extra_module
)
...
...
cmake/scriptCloneModule.sh
View file @
09b1a326
...
...
@@ -4,4 +4,12 @@ urlGitToPackage="$1"
git clone
$urlGitToPackage
if
[
!
-z
$2
]
then
USED_BRANCH
=
"
$2
"
echo
"Switching to '
${
USED_BRANCH
}
'"
git checkout
${
USED_BRANCH
}
fi
cmake/scriptPull.sh
View file @
09b1a326
...
...
@@ -5,4 +5,11 @@ packageDir="$1"
cd
"
$packageDir
"
git pull
if
[
!
-z
$2
]
then
USED_BRANCH
=
"
$2
"
echo
"Switching to '
${
USED_BRANCH
}
'"
git checkout
${
USED_BRANCH
}
fi
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment