Skip to content

Commit

Permalink
add headers to IDE support for header-only libraries
Browse files Browse the repository at this point in the history
Co-authored-by: Kenneth Weiss <[email protected]>
  • Loading branch information
white238 and kennyweiss committed Mar 5, 2024
1 parent e0dc94a commit fa93495
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions cmake/BLTMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,17 @@ macro(blt_add_library)
LIBRARY_TYPE ${_lib_type})
endif()
else()
#
# Header-only library support

add_library( ${arg_NAME} INTERFACE)
# Add header sources for IDE support
set_target_properties( ${arg_NAME} PROPERTIES PRIVATE_HEADER "${arg_HEADERS}")
#
# Note: Will not add header files to header-only interface libraries in older versions
# of CMake when CMP0076 is set to NEW
#
if( ${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.19.0" )
add_library( ${arg_NAME} INTERFACE ${arg_HEADERS} )
else()
add_library( ${arg_NAME} INTERFACE )
endif()
endif()

# Clear value of _have_fortran from previous calls
Expand Down

0 comments on commit fa93495

Please sign in to comment.