Skip to content

Commit

Permalink
Allow consumers to enforce using namespaced includes
Browse files Browse the repository at this point in the history
Setting QUOTIENT_FORCE_NAMESPACED_INCLUDES before the find_package
call will not add the namespace include dir to the search path.

This isn't really elegant, but allows both retaining full source
compatibility and helps consumers that have clashing include file
names.
  • Loading branch information
vkrause committed Apr 23, 2023
1 parent 82c2501 commit 69aa818
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Quotient>
$<INSTALL_INTERFACE:${${PROJECT_NAME}_INSTALL_INCLUDEDIR}>
$<INSTALL_INTERFACE:${${PROJECT_NAME}_INSTALL_INCLUDEDIR}/Quotient>
)

target_link_libraries(${PROJECT_NAME} PUBLIC ${Qt}::Core ${Qt}::Network ${Qt}::Gui qt${${Qt}Core_VERSION_MAJOR}keychain)
Expand Down
6 changes: 6 additions & 0 deletions cmake/QuotientConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ include(CMakeFindDependencyMacro)
@FIND_DEPS@

include("${CMAKE_CURRENT_LIST_DIR}/QuotientTargets.cmake")

if (NOT QUOTIENT_FORCE_NAMESPACED_INCLUDES)
get_target_property(_include_dir @PROJECT_NAME@ INTERFACE_INCLUDE_DIRECTORIES)
list(APPEND _include_dir "${_include_dir}/Quotient")
set_target_properties(@PROJECT_NAME@ PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_include_dir}")
endif()

0 comments on commit 69aa818

Please sign in to comment.