Skip to content

Commit 699ed5c

Browse files
committed
cmake: Configure public include paths for the legacy connector target.
1 parent dfc0005 commit 699ed5c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,15 @@ add_config_option(WITH_JDBC BOOL DEFAULT OFF
330330

331331
if(WITH_JDBC)
332332
add_subdirectory(jdbc)
333+
334+
# Note: Include path must contain build location because
335+
# this is where config.h header is written.
336+
337+
target_include_directories(connector-jdbc
338+
PUBLIC "${PROJECT_BINARY_DIR}/jdbc/cppconn"
339+
PUBLIC "${PROJECT_SOURCE_DIR}/include"
340+
)
341+
333342
endif()
334343

335344

@@ -512,10 +521,6 @@ if(WITH_JDBC)
512521

513522
add_executable(try_jdbc EXCLUDE_FROM_ALL try_jdbc.cc)
514523
target_link_libraries(try_jdbc connector-jdbc)
515-
target_include_directories(try_jdbc
516-
PRIVATE "${PROJECT_BINARY_DIR}/include/mysql"
517-
PRIVATE "${PROJECT_BINARY_DIR}/include/jdbc/cppconn"
518-
)
519524

520525
endif()
521526

0 commit comments

Comments
 (0)