@@ -6,6 +6,10 @@ set(PROJECT_NAME example-robot-data)
6
6
set (PROJECT_DESCRIPTION
7
7
"Set of robot URDFs for benchmarking and developed examples" )
8
8
set (PROJECT_URL https://github.com/${PROJECT_ORG}/${PROJECT_NAME} )
9
+ # To enable jrl-cmakemodules compatibility with workspace we must define the two
10
+ # following lines
11
+ set (PROJECT_AUTO_RUN_FINALIZE FALSE )
12
+ set (PROJECT_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR} )
9
13
10
14
# Project options
11
15
option (BUILD_PYTHON_INTERFACE "Build the python unit tests and helpers" ON )
@@ -51,6 +55,7 @@ endif()
51
55
52
56
# JRL-cmakemodule setup
53
57
include ("${JRL_CMAKE_MODULES} /base.cmake" )
58
+ include ("${JRL_CMAKE_MODULES} /python.cmake" )
54
59
55
60
# Print initial message
56
61
message (STATUS "${PROJECT_DESCRIPTION} , version ${PROJECT_VERSION} " )
@@ -67,20 +72,26 @@ if(BUILD_PYTHON_INTERFACE)
67
72
add_project_dependency (eigenpy 3.0.0 REQUIRED )
68
73
add_project_dependency (pinocchio 2.7.0 REQUIRED )
69
74
string (REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME} )
75
+ findpython (REQUIRED )
70
76
add_subdirectory (python )
71
77
if (BUILD_TESTING )
72
78
add_subdirectory (unittest )
73
79
endif (BUILD_TESTING )
74
- endif (BUILD_PYTHON_INTERFACE )
80
+ endif ()
75
81
76
82
if (NOT INSTALL_PYTHON_INTERFACE_ONLY )
77
83
add_library (${PROJECT_NAME} INTERFACE )
78
- target_include_directories (${PROJECT_NAME}
79
- INTERFACE $< INSTALL_INTERFACE:include> )
84
+ add_library (${PROJECT_NAME} ::${PROJECT_NAME} ALIAS ${PROJECT_NAME} )
85
+ target_include_directories (
86
+ ${PROJECT_NAME}
87
+ INTERFACE $< INSTALL_INTERFACE:include>
88
+ $< BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} /include>
89
+ $< BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} /include> )
80
90
target_compile_definitions (
81
91
${PROJECT_NAME}
82
92
INTERFACE
83
- EXAMPLE_ROBOT_DATA_MODEL_DIR= "$<INSTALL_PREFIX>/share/${PROJECT_NAME} /robots"
93
+ $< INSTALL_INTERFACE:EXAMPLE_ROBOT_DATA_MODEL_DIR="$< INSTALL_PREFIX> /share/${PROJECT_NAME} /robots">
94
+ $< BUILD_INTERFACE:EXAMPLE_ROBOT_DATA_MODEL_DIR="${CMAKE_CURRENT_SOURCE_DIR} /robots">
84
95
)
85
96
install (
86
97
TARGETS ${PROJECT_NAME}
@@ -91,4 +102,6 @@ if(NOT INSTALL_PYTHON_INTERFACE_ONLY)
91
102
DESTINATION include /${CUSTOM_HEADER_DIR} )
92
103
install (DIRECTORY robots DESTINATION share/${PROJECT_NAME} )
93
104
install (FILES package.xml DESTINATION share/${PROJECT_NAME} )
94
- endif (NOT INSTALL_PYTHON_INTERFACE_ONLY )
105
+ endif ()
106
+
107
+ setup_project_finalize ()
0 commit comments