Skip to content

Commit

Permalink
Fix #267 'SQLiteCpp/SQLiteCpp.h' file not found
Browse files Browse the repository at this point in the history
Issue introduced by Commit a166062 Significantly improved support for external sqlite3, and generalized thread and dl libs on Unix/Linux/Mac
  • Loading branch information
SRombauts committed Jan 29, 2020
1 parent ffc1a3e commit 76bd3b2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ install(TARGETS SQLiteCpp
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT libraries)
target_include_directories(SQLiteCpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include/>)
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers FILES_MATCHING REGEX ".*\\.(hpp|h)$")
install(EXPORT ${PROJECT_NAME}Targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})

Expand Down

2 comments on commit 76bd3b2

@emmenlau
Copy link
Contributor

@emmenlau emmenlau commented on 76bd3b2 Jan 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @SRombauts does this really fix the issue? Because it seems like the lines you added exist almost identical a few lines further up. Compare:

target_include_directories(SQLiteCpp
  PRIVATE
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<$<BOOL:${SQLITECPP_INTERNAL_SQLITE}>:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3>
  PUBLIC $<INSTALL_INTERFACE:include/>)

and

target_include_directories(SQLiteCpp PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
  $<INSTALL_INTERFACE:include/>)

Could you instead try to replace PRIVATE in the upper target_include_directories() with PUBLIC? So here is an improved version of the upper target_include_directories():

target_include_directories(SQLiteCpp
  PRIVATE
    $<$<BOOL:${SQLITECPP_INTERNAL_SQLITE}>:${CMAKE_CURRENT_SOURCE_DIR}/sqlite3>
  PUBLIC
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
    $<INSTALL_INTERFACE:include/>)

@SRombauts
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I was clearly in a hurry and just reverted a line you had previously removed.

Thanks for the great feedback!

Please sign in to comment.