Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
project_cpp_template
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
labrobotica
project_cpp_template
Commits
7a949292
Commit
7a949292
authored
5 years ago
by
Fernando Herrero
Browse files
Options
Downloads
Patches
Plain Diff
Modify Find.cmake template using library_name variable. Update new_project.sh accordingly.
parent
b2c36dc5
No related branches found
No related tags found
1 merge request
!1
Install path
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Findlib_template.cmake
+20
-20
20 additions, 20 deletions
Findlib_template.cmake
new_project.sh
+1
-3
1 addition, 3 deletions
new_project.sh
with
21 additions
and
23 deletions
Findlib_template.cmake
+
20
−
20
View file @
7a949292
#edit the following line to add the librarie's header files
FIND_PATH
(
library_name_INCLUDE_DIRS header_file /usr/include/iri/library_name /usr/local/include/iri/library_name
)
SET
(
name library_name
)
FIND_PATH
(
${
name
}
_INCLUDE_DIRS
${
name
}
.h /usr/include/iri/
${
name
}
/usr/local/include/iri/
${
name
}
)
FIND_LIBRARY
(
library_name_LIBRARIES
NAMES library_name
PATHS /usr/lib /usr/lib/iri/library_name /usr/local/lib /usr/local/lib/iri/library_name
)
FIND_LIBRARY
(
${
name
}
_LIBRARIES
NAMES
${
name
}
PATHS /usr/lib /usr/lib/iri/
${
name
}
/usr/local/lib /usr/local/lib/iri/
${
name
}
)
SET
(
${
name
}
_INCLUDE_DIR
${${
name
}
_INCLUDE_DIRS
}
)
SET
(
${
name
}
_LIBRARY
${${
name
}
_LIBRARIES
}
)
SET
(
library_name_INCLUDE_DIR
${
library_name_INCLUDE_DIRS
}
)
SET
(
library_name_LIBRARY
${
library_name_LIBRARIES
}
)
IF
(
library_name_INCLUDE_DIRS AND library_name_LIBRARIES
)
SET
(
library_name_FOUND TRUE
)
ENDIF
(
library_name_INCLUDE_DIRS AND library_name_LIBRARIES
)
IF
(
library_name_FOUND
)
IF
(
NOT library_name_FIND_QUIETLY
)
MESSAGE
(
STATUS
"Found library_name:
${
library_name_LIBRARIES
}
"
)
ENDIF
(
NOT library_name_FIND_QUIETLY
)
ELSE
(
library_name_FOUND
)
IF
(
library_name_FIND_REQUIRED
)
MESSAGE
(
FATAL_ERROR
"Could not find library_name"
)
ENDIF
(
library_name_FIND_REQUIRED
)
ENDIF
(
library_name_FOUND
)
IF
(
${
name
}
_INCLUDE_DIRS AND
${
name
}
_LIBRARIES
)
SET
(
${
name
}
_FOUND TRUE
)
ENDIF
(
${
name
}
_INCLUDE_DIRS AND
${
name
}
_LIBRARIES
)
IF
(
${
name
}
_FOUND
)
IF
(
NOT
${
name
}
_FIND_QUIETLY
)
MESSAGE
(
STATUS
"Found
${
name
}
:
${${
name
}
_LIBRARIES
}
"
)
ENDIF
(
NOT
${
name
}
_FIND_QUIETLY
)
ELSE
(
${
name
}
_FOUND
)
IF
(
${
name
}
_FIND_REQUIRED
)
MESSAGE
(
FATAL_ERROR
"Could not find
${
name
}
"
)
ENDIF
(
${
name
}
_FIND_REQUIRED
)
ENDIF
(
${
name
}
_FOUND
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
new_project.sh
+
1
−
3
View file @
7a949292
...
...
@@ -248,9 +248,7 @@ else
done
mv
CMakeLists.tmp ./src/examples/CMakeLists.txt
sed
's/header_file/'
"
${
NAME
}
.h"
'/g'
<Findlib_template.cmake
>
tmp.cmake
sed
's/library_name/'
$NAME
'/g'
<tmp.cmake
>
./Find
$NAME
.cmake
rm
tmp.cmake
sed
's/library_name/'
$NAME
'/g'
<Findlib_template.cmake
>
./Find
$NAME
.cmake
LIBRARY_NAME
=
$(
echo
$NAME
|
tr
'[:lower:]'
'[:upper:]'
)
Library_name
=
$(
echo
$NAME
|
sed
's/\([a-zA-Z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'
)
...
...
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