56 lines
1.1 KiB
CMake
Executable File
56 lines
1.1 KiB
CMake
Executable File
# NGLDB
|
|
FIND_PACKAGE(PostgreSQL)
|
|
IF(NOT PostgreSQL_FOUND)
|
|
MESSAGE(WARNING "PostgreSQL not found - ngldb will be built without PostgreSQL support")
|
|
ENDIF()
|
|
|
|
OPTION(ENABLE_DB_TRACING "Enable trace output for NGLDB library" OFF)
|
|
IF(ENABLE_DB_TRACING)
|
|
add_compile_definitions(NGLDB_ENABLE_TRACE)
|
|
ENDIF(ENABLE_DB_TRACING)
|
|
|
|
#
|
|
# NGL Database Library
|
|
#
|
|
SET(ngldb_SRCS
|
|
dbcommon.h
|
|
dbconnection.cpp
|
|
dbconnection.h
|
|
db_service_handler.h
|
|
dbtransaction.cpp
|
|
dbtransaction.h
|
|
ngldb_export.h
|
|
ngldb_logger.cpp
|
|
ngldb_logger.h
|
|
nsqlquery.cpp
|
|
nsqlquery.h
|
|
sql_query_janitor.cpp
|
|
sql_query_janitor.h
|
|
)
|
|
|
|
NGL_ADD_LIBRARY2(AAR SV HLA WS ngldb SHARED ${ngldb_SRCS})
|
|
NGL_TARGET_LINK_LIBRARIES(ngldb
|
|
PRIVATE
|
|
NGLLogger
|
|
nglsettings
|
|
PUBLIC
|
|
Qt6::Core
|
|
Qt6::Sql
|
|
)
|
|
IF(PostgreSQL_FOUND)
|
|
NGL_TARGET_LINK_LIBRARIES(ngldb
|
|
PRIVATE
|
|
${PostgreSQL_LIBRARIES}
|
|
)
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(ngldb
|
|
PRIVATE
|
|
${PostgreSQL_INCLUDE_DIR}
|
|
)
|
|
ENDIF()
|
|
NGL_TARGET_INCLUDE_DIRECTORIES(ngldb
|
|
INTERFACE
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../
|
|
)
|
|
|
|
NGL_INSTALL_TARGET(ngldb)
|