fix(build): Data libs CMakeLists #4453

This commit is contained in:
Alex Fabijanic 2024-02-13 23:20:14 +01:00
parent b82fca8337
commit c990b9f890
2 changed files with 21 additions and 4 deletions

View File

@ -38,14 +38,24 @@ if (NOT POCO_DATA_NO_SQL_PARSER)
target_compile_definitions(Data PUBLIC -DSQLParser_EXPORTS)
endif()
target_link_libraries(Data PUBLIC Poco::Foundation)
target_include_directories(Data
if(NOT POCO_DATA_NO_SQL_PARSER)
target_include_directories(Data
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/SQLParser/src
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/SQLParser
)
else()
target_include_directories(Data
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/SQLParser/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/SQLParser>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
)
endif()
POCO_INSTALL(Data)
POCO_GENERATE_PACKAGE(Data)

View File

@ -28,4 +28,11 @@ else()
endif()
target_link_libraries(Data-testrunner PUBLIC Poco::DataTest Poco::Data CppUnit)
if(NOT POCO_DATA_NO_SQL_PARSER)
target_include_directories(Data-testrunner
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../SQLParser/src
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../SQLParser
)
endif()
add_subdirectory(DataTest)