Skip to content

Commit

Permalink
Only from cmake 3.19 is sources supported on interface targets
Browse files Browse the repository at this point in the history
  • Loading branch information
larshg committed Jan 11, 2025
1 parent 515ba04 commit 1339dc5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmake/pcl_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,18 @@ function(PCL_ADD_LIBRARY _name)
endif()

if(NOT ARGS_SOURCES)
add_library(${_name} INTERFACE ${ARGS_INCLUDES})
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
add_library(${_name} INTERFACE ${ARGS_INCLUDES})

set_target_properties(${_name} PROPERTIES FOLDER "Libraries")
else()
add_library(${_name} INTERFACE)
endif()

target_include_directories(${_name} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${INCLUDE_INSTALL_ROOT}>
)
set_target_properties(${_name} PROPERTIES FOLDER "Libraries")
else()
add_library(${_name} ${PCL_LIB_TYPE} ${ARGS_SOURCES})
PCL_ADD_VERSION_INFO(${_name})
Expand Down

0 comments on commit 1339dc5

Please sign in to comment.