Skip to content

Commit 1339dc5

Browse files
committed
Only from cmake 3.19 is sources supported on interface targets
1 parent 515ba04 commit 1339dc5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cmake/pcl_targets.cmake

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,18 @@ function(PCL_ADD_LIBRARY _name)
184184
endif()
185185

186186
if(NOT ARGS_SOURCES)
187-
add_library(${_name} INTERFACE ${ARGS_INCLUDES})
187+
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
188+
add_library(${_name} INTERFACE ${ARGS_INCLUDES})
189+
190+
set_target_properties(${_name} PROPERTIES FOLDER "Libraries")
191+
else()
192+
add_library(${_name} INTERFACE)
193+
endif()
188194

189195
target_include_directories(${_name} INTERFACE
190196
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
191197
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_ROOT}>
192198
)
193-
set_target_properties(${_name} PROPERTIES FOLDER "Libraries")
194199
else()
195200
add_library(${_name} ${PCL_LIB_TYPE} ${ARGS_SOURCES})
196201
PCL_ADD_VERSION_INFO(${_name})

0 commit comments

Comments
 (0)