@@ -268,7 +268,7 @@ endmacro()
268
268
# `--> component is induced ==> warn and remove it
269
269
# from the list
270
270
271
- macro (find_external_library _component _lib _is_optional)
271
+ function (find_external_library _component _lib _is_optional)
272
272
if ("${_lib} " STREQUAL "boost" )
273
273
find_boost()
274
274
elseif ("${_lib} " STREQUAL "eigen" )
@@ -299,13 +299,20 @@ macro(find_external_library _component _lib _is_optional)
299
299
find_glew()
300
300
elseif ("${_lib} " STREQUAL "opengl" )
301
301
find_package (OpenGL)
302
+ elseif ("${_lib} " STREQUAL "pcap" )
303
+ find_package (Pcap)
304
+ elseif ("${_lib} " STREQUAL "png" )
305
+ find_package (PNG)
306
+ else ()
307
+ message (WARNING "${_lib} is not handled by find_external_library" )
302
308
endif ()
303
309
304
310
string (TOUPPER "${_component} " COMPONENT )
305
311
string (TOUPPER "${_lib} " LIB)
306
312
string (REGEX REPLACE "[.-]" "_" LIB ${LIB} )
307
313
if (${LIB} _FOUND)
308
314
list (APPEND PCL_${COMPONENT} _INCLUDE_DIRS ${${LIB} _INCLUDE_DIRS})
315
+ set (PCL_${COMPONENT} _INCLUDE_DIRS ${PCL_${COMPONENT} _INCLUDE_DIRS} PARENT_SCOPE)
309
316
310
317
if (${LIB} MATCHES "VTK" )
311
318
if (${${LIB} _VERSION_MAJOR} GREATER_EQUAL 9)
@@ -317,12 +324,16 @@ macro(find_external_library _component _lib _is_optional)
317
324
include (${${LIB} _USE_FILE})
318
325
else ()
319
326
list (APPEND PCL_${COMPONENT} _LIBRARY_DIRS "${${LIB} _LIBRARY_DIRS}" )
327
+ set (PCL_${COMPONENT} _LIBRARY_DIRS ${PCL_${COMPONENT} _LIBRARY_DIRS} PARENT_SCOPE)
320
328
endif ()
321
329
if (${LIB} _LIBRARIES)
322
330
list (APPEND PCL_${COMPONENT} _LINK_LIBRARIES "${${LIB} _LIBRARIES}" )
331
+ set (PCL_${COMPONENT} _LINK_LIBRARIES ${PCL_${COMPONENT} _LINK_LIBRARIES} PARENT_SCOPE)
332
+ set (PCL_${LIB} _LIBRARIES ${${LIB} _LIBRARIES} PARENT_SCOPE) # Later appended to PCL_LIBRARIES
323
333
endif ()
324
334
if (${LIB} _DEFINITIONS AND NOT ${LIB} STREQUAL "VTK" )
325
335
list (APPEND PCL_${COMPONENT} _DEFINITIONS ${${LIB} _DEFINITIONS})
336
+ set (PCL_${COMPONENT} _DEFINITIONS ${PCL_${COMPONENT} _DEFINITIONS} PARENT_SCOPE)
326
337
endif ()
327
338
else ()
328
339
if ("${_is_optional} " STREQUAL "OPTIONAL" )
@@ -339,7 +350,7 @@ macro(find_external_library _component _lib _is_optional)
339
350
endif ()
340
351
endif ()
341
352
endif ()
342
- endmacro ()
353
+ endfunction ()
343
354
344
355
macro (pcl_check_external_dependency _component)
345
356
endmacro ()
@@ -658,7 +669,7 @@ endif()
658
669
pcl_remove_duplicate_libraries(PCL_COMPONENTS PCL_LIBRARIES)
659
670
660
671
# Add 3rd party libraries, as user code might include our .HPP implementations
661
- list (APPEND PCL_LIBRARIES ${BOOST_LIBRARIES } ${OPENNI_LIBRARIES } ${OPENNI2_LIBRARIES } ${ENSENSO_LIBRARIES } ${davidSDK_LIBRARIES } ${DSSDK_LIBRARIES } ${RSSDK_LIBRARIES } ${RSSDK2_LIBRARIES } ${VTK_LIBRARIES } )
672
+ list (APPEND PCL_LIBRARIES ${PCL_BOOST_LIBRARIES } ${PCL_OPENNI_LIBRARIES } ${PCL_OPENNI2_LIBRARIES } ${PCL_ENSENSO_LIBRARIES } ${PCL_davidSDK_LIBRARIES } ${PCL_DSSDK_LIBRARIES } ${PCL_RSSDK_LIBRARIES } ${PCL_RSSDK2_LIBRARIES } ${PCL_VTK_LIBRARIES } )
662
673
if (TARGET FLANN::FLANN)
663
674
list (APPEND PCL_LIBRARIES FLANN::FLANN)
664
675
endif ()
0 commit comments