Skip to content

Commit

Permalink
avoid using target_sources
Browse files Browse the repository at this point in the history
  • Loading branch information
white238 committed Mar 1, 2024
1 parent 9ac60ad commit 67a4d79
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions cmake/BLTMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,9 @@ macro(blt_add_library)
LIBRARY_TYPE ${_lib_type})
endif()
else()
#
# Header-only library support
#
foreach (_file ${arg_HEADERS})
# Determine build location of headers
get_filename_component(_absolute ${_file} ABSOLUTE)
list(APPEND _build_headers ${_absolute})
endforeach()

#Note: This only works if both libraries are handled in the same directory,
# otherwise just don't include non-header files in your source list.
set_source_files_properties(${_build_headers} PROPERTIES HEADER_FILE_ONLY ON)

add_library( ${arg_NAME} INTERFACE )
target_sources( ${arg_NAME} INTERFACE
$<BUILD_INTERFACE:${_build_headers}>)
add_library( ${arg_NAME} INTERFACE ${arg_HEADERS})
endif()

# Clear value of _have_fortran from previous calls
Expand Down

0 comments on commit 67a4d79

Please sign in to comment.