Skip to content
Snippets Groups Projects
Commit 7cdf18a2 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Change install paths, now is .../iri/<library_name instead of .../iridrivers....

Change install paths, now is .../iri/<library_name instead of .../iridrivers. Find cmake: switch to plural cmake variables, _INCLUDE_DIRS and _LIBRARIES, although. Fix project_name: underscore _ instead of dash -. Removed old template.tar.gz, no needed anymore
 singular names are kept for backward compatibility
parent 41a7d599
No related branches found
No related tags found
1 merge request!1Install path
#edit the following line to add the librarie's header files #edit the following line to add the librarie's header files
FIND_PATH(library_name_INCLUDE_DIR header_file /usr/include/iridrivers /usr/local/include/iridrivers) FIND_PATH(library_name_INCLUDE_DIRS header_file /usr/include/iri/library_name /usr/local/include/iri/library_name)
FIND_LIBRARY(library_name_LIBRARY FIND_LIBRARY(library_name_LIBRARIES
NAMES library_name NAMES library_name
PATHS /usr/lib /usr/local/lib /usr/local/lib/iridrivers) PATHS /usr/lib /usr/lib/iri/library_name /usr/local/lib /usr/local/lib/iri/library_name)
IF (library_name_INCLUDE_DIR AND library_name_LIBRARY) 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) SET(library_name_FOUND TRUE)
ENDIF (library_name_INCLUDE_DIR AND library_name_LIBRARY) ENDIF (library_name_INCLUDE_DIRS AND library_name_LIBRARIES)
IF (library_name_FOUND) IF (library_name_FOUND)
IF (NOT library_name_FIND_QUIETLY) IF (NOT library_name_FIND_QUIETLY)
MESSAGE(STATUS "Found library_name: ${library_name_LIBRARY}") MESSAGE(STATUS "Found library_name: ${library_name_LIBRARIES}")
ENDIF (NOT library_name_FIND_QUIETLY) ENDIF (NOT library_name_FIND_QUIETLY)
ELSE (library_name_FOUND) ELSE (library_name_FOUND)
IF (library_name_FIND_REQUIRED) IF (library_name_FIND_REQUIRED)
......
...@@ -68,11 +68,11 @@ To use this library in an other library or application, in the CMakeLists.txt fi ...@@ -68,11 +68,11 @@ To use this library in an other library or application, in the CMakeLists.txt fi
In the case that the package is present, it is necessary to add the header files directory to the include directory path by using In the case that the package is present, it is necessary to add the header files directory to the include directory path by using
``` INCLUDE_DIRECTORIES(${project_name_INCLUDE_DIR}) ``` ``` INCLUDE_DIRECTORIES(${project_name_INCLUDE_DIRS}) ```
and it is also necessary to link with the desired libraries by using the following command and it is also necessary to link with the desired libraries by using the following command
``` TARGET_LINK_LIBRARIES(<executable name> ${project_name_LIBRARY}) ``` ``` TARGET_LINK_LIBRARIES(<executable name> ${project_name_LIBRARIES}) ```
## Disclaimer ## Disclaimer
......
...@@ -160,7 +160,8 @@ rm tmp3.md ...@@ -160,7 +160,8 @@ rm tmp3.md
rm ReadMe_template.md rm ReadMe_template.md
#Set the project name on the CMakeLists.txt script file #Set the project name on the CMakeLists.txt script file
NEW_NAME=$(echo $NAME | sed 's/_/-/g') #NEW_NAME=$(echo $NAME | sed 's/_/-/g')
NEW_NAME=$NAME
if [ $TEST = 1 ] if [ $TEST = 1 ]
then then
sed 's/project_name/'$NEW_NAME'/g' <CMakeLists_test_template.txt >./CMakeLists.txt sed 's/project_name/'$NEW_NAME'/g' <CMakeLists_test_template.txt >./CMakeLists.txt
...@@ -227,9 +228,9 @@ else ...@@ -227,9 +228,9 @@ else
done done
echo "INSTALL(TARGETS $NAME" >> CMakeLists.tmp echo "INSTALL(TARGETS $NAME" >> CMakeLists.tmp
echo " RUNTIME DESTINATION bin" >> CMakeLists.tmp echo " RUNTIME DESTINATION bin" >> CMakeLists.tmp
echo " LIBRARY DESTINATION lib/iridrivers" >> CMakeLists.tmp echo " LIBRARY DESTINATION lib/iri/${NAME}" >> CMakeLists.tmp
echo " ARCHIVE DESTINATION lib/iridrivers)" >> CMakeLists.tmp echo " ARCHIVE DESTINATION lib/iri/${NAME})" >> CMakeLists.tmp
echo "INSTALL(FILES "'${'"headers"'}' "DESTINATION include/iridrivers)" >> CMakeLists.tmp echo "INSTALL(FILES "'${'"headers"'}' "DESTINATION include/iri/${NAME})" >> CMakeLists.tmp
echo "INSTALL(FILES ../Find$NAME.cmake DESTINATION "'${'"CMAKE_ROOT"'}'"/Modules/)" >> CMakeLists.tmp echo "INSTALL(FILES ../Find$NAME.cmake DESTINATION "'${'"CMAKE_ROOT"'}'"/Modules/)" >> CMakeLists.tmp
echo "ADD_SUBDIRECTORY(examples)" >> CMakeLists.tmp echo "ADD_SUBDIRECTORY(examples)" >> CMakeLists.tmp
mv CMakeLists.tmp ./src/CMakeLists.txt mv CMakeLists.tmp ./src/CMakeLists.txt
...@@ -281,6 +282,5 @@ rm driver_src_template.cpp ...@@ -281,6 +282,5 @@ rm driver_src_template.cpp
rm driver_header_template.h rm driver_header_template.h
rm driver_example_src_template.cpp rm driver_example_src_template.cpp
rm Findlib_template.cmake rm Findlib_template.cmake
rm template.tar.gz
rm new_project.sh rm new_project.sh
rm -rf .git rm -rf .git
File deleted
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