Skip to content

Commit 1398b88

Browse files
committed
CMakeLists.txt add install command to work on
> catkin config --install > catkin build -vi --summarize we checked that necessary files are installed ``` (export ROS_PACKAGE_PATH=$(pwd)/src; for dir in install/share/*; do pkg=$(basename $dir); echo -e "\n\n$pkg"; echo diff -r install/share/$pkg $(rospack find $pkg) --exclude CMakeLists.txt --exclude .gitignore --exclude setup.py --exclude README.md --exclude CHANGELOG.rst --exclude cmake ; ./check.py $(basename $dir); done > diff.dir) ``` where `check.py` is ``` import sys import os import copy import filecmp import rospkg def compare_directories(install_dir, src_dir, ignore=None): # Initialize dictionaries to store results results = { 'unique_to_dir1': [], 'unique_to_dir2': [], 'differences': [], 'common_files': [] } # Recursively compare directory structures and files comparison = filecmp.dircmp(install_dir, src_dir, ignore=ignore) # Files only in dir1 results['unique_to_dir1'] = comparison.left_only # Files only in dir2 results['unique_to_dir2'] = comparison.right_only # Files present in both directories but different results['differences'] = comparison.diff_files # Files that are identical in both directories results['common_files'] = comparison.same_files return results def list_all_subdirectories(root_dir): subdirectories = [] for dirpath, dirnames, _ in os.walk(root_dir): for dirname in dirnames: subdirectories.append(os.path.join(dirpath, dirname)) return subdirectories if __name__ == '__main__': rospack = rospkg.RosPack() pkg_name = sys.argv[1] pkg_path = rospack.get_path(pkg_name) print("## Check [{}]".format(pkg_name)) for dir in ['.'] + [os.path.relpath(dir, pkg_path) for dir in list_all_subdirectories(pkg_path)]: install_dir = os.path.join('install/share/', pkg_name, dir) src_dir = os.path.join(pkg_path, dir) if os.path.exists(install_dir): differences = compare_directories(install_dir, src_dir, ignore=['env-hooks', 'cmake', '.gitignore', 'CMakeLists.txt', 'CHANGELOG.rst', 'README.md', 'setup.py']) else: print('> Only in {}'.format(src_dir)) continue # Display the results for file in differences['unique_to_dir1']: print("> Files only in directory 1: {}".format([os.path.join(dir, file)])) for file in copy.copy(differences['unique_to_dir2']): if os.path.exists(os.path.join('install/lib/', pkg_name, file)): differences['unique_to_dir2'].remove(file) for file in differences['unique_to_dir2']: print("> Files only in directory 2: {}".format([os.path.join(dir, file)])) for file in differences['differences']: print("> Different files: {}".format([os.path.join(dir, file)])) #print("Common files (identical):", differences['common_files']) ``` ```
1 parent 25dd087 commit 1398b88

27 files changed

Lines changed: 155 additions & 27 deletions

File tree

jsk_aero_robot/aeroeus/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ catkin_package(
88

99
## rosrun euscollada collada2eus_urdfmodel $(rospack find aero_description)/robots/aero.urdf $(rospack find aero_description)/robots/aero.yaml aero.l
1010

11-
install(FILES aero-interface.l aero-hand.l aero-wheels.l DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
11+
file(GLOB LISP_FILES *.l)
12+
install(FILES ${LISP_FILES} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

jsk_aero_robot/jsk_aero_startup/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endif()
1010
find_package(catkin REQUIRED)
1111
catkin_package()
1212

13-
install(DIRECTORY launch raw_maps scripts
13+
install(DIRECTORY launch raw_maps scripts config test
1414
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
1515
USE_SOURCE_PERMISSIONS)
1616

jsk_baxter_robot/baxtereus/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ install(DIRECTORY euslisp test
6565
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
6666
USE_SOURCE_PERMISSIONS)
6767

68-
install(FILES baxter.l baxter-interface.l baxter-util.l baxter.yaml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
68+
file(GLOB LISP_FILES *.l)
69+
install(FILES ${LISP_FILES} baxter.yaml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
6970

7071
if(CATKIN_ENABLE_TESTING)
7172
find_package(catkin REQUIRED COMPONENTS rostest)

jsk_baxter_robot/jsk_baxter_startup/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ include_directories(
1717
catkin_add_env_hooks(99.jsk_baxter_startup SHELLS bash zsh
1818
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)
1919

20-
install(DIRECTORY config jsk_baxter_joy jsk_baxter_lifelog jsk_baxter_moveit jsk_baxter_sensors jsk_baxter_tools
20+
install(DIRECTORY config jsk_baxter_joy jsk_baxter_lifelog jsk_baxter_moveit jsk_baxter_sensors jsk_baxter_tools jsk_baxter_description jsk_baxter_machine jsk_baxter_udev
2121
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
2222
USE_SOURCE_PERMISSIONS)
2323

24-
install(FILES baxter.launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
24+
file(GLOB LAUNCH_FILES *.launch)
25+
install(FILES ${LAUNCH_FILES} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
2526

jsk_baxter_robot/jsk_baxter_web/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ include_directories(
2929
${catkin_INCLUDE_DIRS}
3030
)
3131

32-
install(DIRECTORY launch
32+
install(DIRECTORY launch www
3333
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
3434
USE_SOURCE_PERMISSIONS)

jsk_denso_robot/cobottaeus/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@ add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/cobotta.l
4343
add_custom_target(compile_cobotta ALL DEPENDS ${PROJECT_SOURCE_DIR}/cobotta.l)
4444

4545

46-
install(DIRECTORY euslisp test
46+
install(DIRECTORY sample test
4747
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
4848
USE_SOURCE_PERMISSIONS)
4949

50-
install(FILES cobotta.l cobotta-interface.l cobotta-util.l cobotta.yaml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
50+
file(GLOB LISP_FILES *.l)
51+
install(FILES ${LISP_FILES} cobotta.yaml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
5152

5253
if(CATKIN_ENABLE_TESTING)
5354
find_package(catkin REQUIRED COMPONENTS rostest)

jsk_denso_robot/jsk_cobotta_startup/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ catkin_package()
3333
#############
3434
## Install ##
3535
#############
36-
install(DIRECTORY config launch scripts data
36+
install(DIRECTORY launch
3737
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
3838
USE_SOURCE_PERMISSIONS)
3939

40-
install(FILES jsk_cobotta.machine
41-
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
40+
# install(FILES jsk_cobotta.machine
41+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})
4242

4343
#############
4444
## Testing ##

jsk_fetch_robot/jsk_fetch_gazebo_demo/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(jsk_fetch_gazebo_demo)
44
find_package(catkin)
55
catkin_package()
66

7-
install(DIRECTORY euslisp launch config
7+
install(DIRECTORY euslisp launch config test
88
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
99
USE_SOURCE_PERMISSIONS
1010
)

jsk_fetch_robot/jsk_fetch_startup/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,15 @@ catkin_add_env_hooks(99.jsk_fetch_startup SHELLS bash zsh sh
2323
#############
2424
## Install ##
2525
#############
26-
install(DIRECTORY config launch scripts data
26+
file(GLOB_RECURSE SCRIPT_PROGRAMS scripts/*)
27+
foreach(SCRIPT_PROGRAM ${SCRIPT_PROGRAMS})
28+
if("${SCRIPT_PROGRAM}" MATCHES ".*\\.py$")
29+
catkin_install_python(PROGRAMS ${SCRIPT_PROGRAM} DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
30+
else()
31+
install(PROGRAMS ${SCRIPT_PROGRAM} DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/scripts/)
32+
endif()
33+
endforeach()
34+
install(DIRECTORY config launch data apps euslisp robots supervisor_scripts tmuxinator_yaml udev_rules upstart_scripts
2735
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
2836
USE_SOURCE_PERMISSIONS)
2937

jsk_kinova_robot/jsk_kinova_startup/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ catkin_package()
1414
#############
1515
## Install ##
1616
#############
17-
install(DIRECTORY config launch
17+
install(DIRECTORY config launch scripts
1818
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
1919
USE_SOURCE_PERMISSIONS)
2020

0 commit comments

Comments
 (0)