@@ -118,9 +118,6 @@ macro(PCL_SUBSYS_DEPEND _var)
118118 if (NOT _status)
119119 set (${_var} FALSE )
120120 PCL_SET_SUBSYS_STATUS (${_name} FALSE "Requires ${_dep} ." )
121- else ()
122- PCL_GET_SUBSYS_INCLUDE_DIR (_include_dir ${_dep} )
123- include_directories (${PROJECT_SOURCE_DIR} /${_include_dir}/include )
124121 endif ()
125122 endforeach ()
126123 endif ()
@@ -134,12 +131,6 @@ macro(PCL_SUBSYS_DEPEND _var)
134131 endif ()
135132 endforeach ()
136133 endif ()
137- if (ARGS_OPT_DEPS)
138- foreach (_dep ${ARGS_OPT_DEPS} )
139- PCL_GET_SUBSYS_INCLUDE_DIR (_include_dir ${_dep} )
140- include_directories (${PROJECT_SOURCE_DIR} /${_include_dir}/include )
141- endforeach ()
142- endif ()
143134 endif ()
144135endmacro ()
145136
@@ -266,30 +257,39 @@ function(PCL_CUDA_ADD_LIBRARY _name)
266257 endif ()
267258
268259 REMOVE_VTK_DEFINITIONS ()
260+ if (NOT ARGS_SOURCES)
261+ add_library (${_name} INTERFACE )
262+
263+ target_include_directories (${_name} INTERFACE
264+ $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /include >
265+ $<INSTALL_INTERFACE :${INCLUDE_INSTALL_ROOT} >
266+ )
269267
270- add_library (${_name} ${PCL_LIB_TYPE} ${ARGS_SOURCES} )
271-
272- PCL_ADD_VERSION_INFO (${_name} )
273-
274- target_compile_options (${_name} PRIVATE $<$<COMPILE_LANGUAGE :CUDA >: ${GEN_CODE} --expt -relaxed -constexpr >)
275-
276- target_include_directories (${_name} PUBLIC
277- $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /include >
278- $<INSTALL_INTERFACE :${INCLUDE_INSTALL_ROOT} >
279- )
280-
281- target_include_directories (${_name} PRIVATE ${CUDA_TOOLKIT_INCLUDE} )
282-
283- if (MSVC )
284- target_link_libraries (${_name} delayimp.lib ) # because delay load is enabled for openmp.dll
268+ else ()
269+ add_library (${_name} ${PCL_LIB_TYPE} ${ARGS_SOURCES} )
270+
271+ PCL_ADD_VERSION_INFO (${_name} )
272+
273+ target_compile_options (${_name} PRIVATE $<$<COMPILE_LANGUAGE :CUDA >: ${GEN_CODE} --expt -relaxed -constexpr >)
274+
275+ target_include_directories (${_name} PUBLIC
276+ $<BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR} /include >
277+ $<INSTALL_INTERFACE :${INCLUDE_INSTALL_ROOT} >
278+ )
279+
280+ target_include_directories (${_name} PRIVATE ${CUDA_TOOLKIT_INCLUDE} )
281+
282+ if (MSVC )
283+ target_link_libraries (${_name} delayimp.lib ) # because delay load is enabled for openmp.dll
284+ endif ()
285+
286+ set_target_properties (${_name} PROPERTIES
287+ VERSION ${PCL_VERSION}
288+ SOVERSION ${PCL_VERSION_MAJOR} .${PCL_VERSION_MINOR}
289+ DEFINE_SYMBOL "PCLAPI_EXPORTS" )
290+ set_target_properties (${_name} PROPERTIES FOLDER "Libraries" )
285291 endif ()
286292
287- set_target_properties (${_name} PROPERTIES
288- VERSION ${PCL_VERSION}
289- SOVERSION ${PCL_VERSION_MAJOR} .${PCL_VERSION_MINOR}
290- DEFINE_SYMBOL "PCLAPI_EXPORTS" )
291- set_target_properties (${_name} PROPERTIES FOLDER "Libraries" )
292-
293293 install (TARGETS ${_name}
294294 RUNTIME DESTINATION ${BIN_INSTALL_DIR} COMPONENT pcl_${ARGS_COMPONENT}
295295 LIBRARY DESTINATION ${LIB_INSTALL_DIR} COMPONENT pcl_${ARGS_COMPONENT}
0 commit comments