Skip to content

Commit d78c4d5

Browse files
committed
Automatically propagate public headers to other projects with CMake
1 parent 57d991b commit d78c4d5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ include_directories("${PROJECT_SOURCE_DIR}/include")
157157

158158
# add sources of the wrapper as a "SQLiteCpp" static library
159159
add_library(SQLiteCpp ${SQLITECPP_SRC} ${SQLITECPP_INC} ${SQLITECPP_DOC} ${SQLITECPP_SCRIPT})
160+
target_include_directories(SQLiteCpp PUBLIC "${PROJECT_SOURCE_DIR}/include")
160161

161162
if (UNIX AND (CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang"))
162163
set_target_properties(SQLiteCpp PROPERTIES COMPILE_FLAGS "-fPIC")
@@ -170,6 +171,7 @@ if (SQLITECPP_INTERNAL_SQLITE)
170171
# build the SQLite3 C library (for ease of use/compatibility) versus Linux sqlite3-dev package
171172
add_subdirectory(sqlite3)
172173
include_directories("${PROJECT_SOURCE_DIR}/sqlite3")
174+
target_include_directories(sqlite3 PUBLIC "${PROJECT_SOURCE_DIR}/sqlite3")
173175
endif (SQLITECPP_INTERNAL_SQLITE)
174176

175177

0 commit comments

Comments
 (0)