mirror of
https://github.com/pocoproject/poco.git
synced 2025-06-02 05:05:02 +02:00
cmake: Data cleanup
- explicitly list files - use find_package for MySQL and ODBC - remove unused code - remove unnecessary include dirs - support unbundled SQLite3 - replace tabs by spaces Reviewed-by: Roger Meier <r.meier@siemens.com>
This commit is contained in:
parent
216ecd3ec2
commit
0fd90ec722
@ -1,11 +1,46 @@
|
|||||||
set(LIBNAME "PocoData")
|
set(LIBNAME "PocoData")
|
||||||
|
|
||||||
set(SRCS "")
|
set(SRCS
|
||||||
aux_source_directory(src SRCS)
|
src/AbstractBinder.cpp
|
||||||
include_directories( SQLite/include )
|
src/AbstractBinding.cpp
|
||||||
|
src/AbstractExtraction.cpp
|
||||||
|
src/AbstractExtractor.cpp
|
||||||
|
src/AbstractPreparation.cpp
|
||||||
|
src/AbstractPreparator.cpp
|
||||||
|
src/ArchiveStrategy.cpp
|
||||||
|
src/Bulk.cpp
|
||||||
|
src/Connector.cpp
|
||||||
|
src/DataException.cpp
|
||||||
|
src/Date.cpp
|
||||||
|
src/DynamicLOB.cpp
|
||||||
|
src/Limit.cpp
|
||||||
|
src/MetaColumn.cpp
|
||||||
|
src/PooledSessionHolder.cpp
|
||||||
|
src/PooledSessionImpl.cpp
|
||||||
|
src/Position.cpp
|
||||||
|
src/Range.cpp
|
||||||
|
src/RecordSet.cpp
|
||||||
|
src/Row.cpp
|
||||||
|
src/RowFilter.cpp
|
||||||
|
src/RowFormatter.cpp
|
||||||
|
src/RowIterator.cpp
|
||||||
|
src/Session.cpp
|
||||||
|
src/SessionFactory.cpp
|
||||||
|
src/SessionImpl.cpp
|
||||||
|
src/SessionPoolContainer.cpp
|
||||||
|
src/SessionPool.cpp
|
||||||
|
src/SimpleRowFormatter.cpp
|
||||||
|
src/SQLChannel.cpp
|
||||||
|
src/Statement.cpp
|
||||||
|
src/StatementCreator.cpp
|
||||||
|
src/StatementImpl.cpp
|
||||||
|
src/Time.cpp
|
||||||
|
src/Transaction.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if (NOT POCO_STATIC)
|
if (NOT POCO_STATIC)
|
||||||
add_definitions(-DData_EXPORTS -DTHREADSAFE -DODBC_EXPORTS -DMySQL_EXPORTS -DSQLite_EXPORTS)
|
add_definitions(-DData_EXPORTS -DTHREADSAFE -DODBC_EXPORTS -DMySQL_EXPORTS -DSQLite_EXPORTS)
|
||||||
endif (NOT POCO_STATIC)
|
endif (NOT POCO_STATIC)
|
||||||
|
|
||||||
if(MSVC AND NOT(MSVC_VERSION LESS 1400))
|
if(MSVC AND NOT(MSVC_VERSION LESS 1400))
|
||||||
@ -14,9 +49,9 @@ if(MSVC AND NOT(MSVC_VERSION LESS 1400))
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
||||||
set_target_properties( ${LIBNAME}
|
set_target_properties( ${LIBNAME}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
||||||
target_link_libraries( ${LIBNAME} PocoFoundation)
|
target_link_libraries( ${LIBNAME} PocoFoundation)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
@ -24,7 +59,7 @@ install(
|
|||||||
DESTINATION include
|
DESTINATION include
|
||||||
PATTERN ".svn" EXCLUDE
|
PATTERN ".svn" EXCLUDE
|
||||||
)
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS ${LIBNAME}
|
TARGETS ${LIBNAME}
|
||||||
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||||
@ -32,27 +67,28 @@ install(
|
|||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# SQlite3 is built in any case
|
||||||
add_subdirectory( SQLite )
|
add_subdirectory( SQLite )
|
||||||
|
|
||||||
|
find_package(MySQL)
|
||||||
if(MYSQL_FOUND)
|
if(MYSQL_FOUND)
|
||||||
add_subdirectory( MySQL )
|
add_subdirectory( MySQL )
|
||||||
endif(MYSQL_FOUND)
|
endif(MYSQL_FOUND)
|
||||||
|
|
||||||
include(FindODBC)
|
find_package(ODBC)
|
||||||
|
|
||||||
if(CMAKE_SYSTEM MATCHES "Windows")
|
if(CMAKE_SYSTEM MATCHES "Windows")
|
||||||
message(STATUS "Windows native ODBC Support Enabled")
|
message(STATUS "Windows native ODBC Support Enabled")
|
||||||
add_subdirectory( ODBC )
|
add_subdirectory( ODBC )
|
||||||
else ()
|
else ()
|
||||||
if ( ${UNIX_ODBC_CONFIG} STREQUAL UNIX_ODBC_CONFIG-NOTFOUND AND ${IODBC_CONFIG} STREQUAL IODBC_CONFIG-NOTFOUND)
|
if ( ${UNIX_ODBC_CONFIG} STREQUAL UNIX_ODBC_CONFIG-NOTFOUND AND ${IODBC_CONFIG} STREQUAL IODBC_CONFIG-NOTFOUND)
|
||||||
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
||||||
else ()
|
else ()
|
||||||
message(STATUS "ODBC Support Enabled")
|
message(STATUS "ODBC Support Enabled")
|
||||||
add_subdirectory( ODBC )
|
add_subdirectory( ODBC )
|
||||||
endif ()
|
endif ()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_TESTS)
|
if (ENABLE_TESTS)
|
||||||
add_subdirectory(samples)
|
add_subdirectory(samples)
|
||||||
add_subdirectory(testsuite)
|
add_subdirectory(testsuite)
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -1,17 +1,26 @@
|
|||||||
set(LIBNAME "PocoDataMySQL")
|
set(LIBNAME "PocoDataMySQL")
|
||||||
|
|
||||||
set(SRCS "")
|
set(SRCS
|
||||||
aux_source_directory(src SRCS)
|
src/Binder.cpp
|
||||||
|
src/Connector.cpp
|
||||||
|
src/Extractor.cpp
|
||||||
|
src/MySQLException.cpp
|
||||||
|
src/MySQLStatementImpl.cpp
|
||||||
|
src/ResultMetadata.cpp
|
||||||
|
src/SessionHandle.cpp
|
||||||
|
src/SessionImpl.cpp
|
||||||
|
src/StatementExecutor.cpp
|
||||||
|
src/Utility.cpp
|
||||||
|
)
|
||||||
|
|
||||||
add_definitions(-DTHREADSAFE -DNO_TCL)
|
add_definitions(-DTHREADSAFE -DNO_TCL)
|
||||||
|
|
||||||
include_directories( include ${MYSQL_INCLUDE_DIR})
|
include_directories( include ${MYSQL_INCLUDE_DIR})
|
||||||
#link_directories( )
|
|
||||||
|
|
||||||
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
||||||
set_target_properties( ${LIBNAME}
|
set_target_properties( ${LIBNAME}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
||||||
target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${MYSQL_LIB})
|
target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${MYSQL_LIB})
|
||||||
|
|
||||||
install(
|
install(
|
||||||
@ -28,5 +37,5 @@ install(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (ENABLE_TESTS)
|
if (ENABLE_TESTS)
|
||||||
add_subdirectory(testsuite)
|
add_subdirectory(testsuite)
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
set(LIBNAME "PocoDataODBC")
|
set(LIBNAME "PocoDataODBC")
|
||||||
|
|
||||||
set(SRCS
|
set(SRCS
|
||||||
src/Binder.cpp
|
src/Binder.cpp
|
||||||
src/ConnectionHandle.cpp
|
src/ConnectionHandle.cpp
|
||||||
src/Connector.cpp
|
src/Connector.cpp
|
||||||
src/EnvironmentHandle.cpp
|
src/EnvironmentHandle.cpp
|
||||||
src/Extractor.cpp
|
src/Extractor.cpp
|
||||||
src/ODBCException.cpp
|
src/ODBCException.cpp
|
||||||
src/ODBCMetaColumn.cpp
|
src/ODBCMetaColumn.cpp
|
||||||
src/ODBCStatementImpl.cpp
|
src/ODBCStatementImpl.cpp
|
||||||
src/Parameter.cpp
|
src/Parameter.cpp
|
||||||
src/Preparator.cpp
|
src/Preparator.cpp
|
||||||
src/SessionImpl.cpp
|
src/SessionImpl.cpp
|
||||||
src/TypeInfo.cpp
|
src/TypeInfo.cpp
|
||||||
src/Unicode.cpp
|
src/Unicode.cpp
|
||||||
src/Utility.cpp
|
src/Utility.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_definitions( ${ODBC_CFLAGS} )
|
add_definitions( ${ODBC_CFLAGS} )
|
||||||
@ -23,8 +23,8 @@ include_directories( include )
|
|||||||
|
|
||||||
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
||||||
set_target_properties( ${LIBNAME}
|
set_target_properties( ${LIBNAME}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
||||||
target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${ODBC_LINK_FLAGS})
|
target_link_libraries( ${LIBNAME} PocoData PocoFoundation ${ODBC_LINK_FLAGS})
|
||||||
|
|
||||||
install(
|
install(
|
||||||
@ -41,5 +41,5 @@ install(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (ENABLE_TESTS)
|
if (ENABLE_TESTS)
|
||||||
add_subdirectory(testsuite)
|
add_subdirectory(testsuite)
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -1,34 +1,33 @@
|
|||||||
set(LIBNAME "PocoDataSQLite")
|
set(LIBNAME "PocoDataSQLite")
|
||||||
|
|
||||||
include_directories( include src )
|
set(SRCS
|
||||||
|
src/Binder.cpp
|
||||||
set(SRCS "")
|
src/Connector.cpp
|
||||||
|
src/Extractor.cpp
|
||||||
set(SRCS
|
src/Notifier.cpp
|
||||||
src/Binder.cpp
|
src/SessionImpl.cpp
|
||||||
src/Connector.cpp
|
src/SQLiteException.cpp
|
||||||
src/Extractor.cpp
|
src/SQLiteStatementImpl.cpp
|
||||||
src/Notifier.cpp
|
src/Utility.cpp
|
||||||
src/SQLiteException.cpp
|
|
||||||
src/SQLiteStatementImpl.cpp
|
|
||||||
src/SessionImpl.cpp
|
|
||||||
src/Utility.cpp
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
include_directories( "include" src )
|
||||||
|
|
||||||
if (POCO_UNBUNDLED)
|
if (POCO_UNBUNDLED)
|
||||||
set(DATASQLITELIBS PocoData PocoFoundation sqlite3)
|
find_package(SQLite3)
|
||||||
|
set(DATASQLITELIBS PocoData PocoFoundation ${SQLITE3_LIBRARIES})
|
||||||
|
include_directories(${SQLITE3_INCLUDE_DIRS})
|
||||||
else()
|
else()
|
||||||
set(SRCS ${SRCS} src/sqlite3.c)
|
set(SRCS ${SRCS} src/sqlite3.c)
|
||||||
set(DATASQLITELIBS PocoData PocoFoundation)
|
set(DATASQLITELIBS PocoData PocoFoundation)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED)
|
add_definitions(-DSQLITE_THREADSAFE=1 -DSQLITE_DISABLE_LFS -DSQLITE_OMIT_UTF16 -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_COMPLETE -DSQLITE_OMIT_TCL_VARIABLE -DSQLITE_OMIT_DEPRECATED)
|
||||||
|
|
||||||
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
||||||
set_target_properties( ${LIBNAME}
|
set_target_properties( ${LIBNAME}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
||||||
target_link_libraries( ${LIBNAME} ${DATASQLITELIBS} )
|
target_link_libraries( ${LIBNAME} ${DATASQLITELIBS} )
|
||||||
|
|
||||||
install(
|
install(
|
||||||
@ -36,7 +35,7 @@ install(
|
|||||||
DESTINATION include
|
DESTINATION include
|
||||||
PATTERN ".svn" EXCLUDE
|
PATTERN ".svn" EXCLUDE
|
||||||
)
|
)
|
||||||
|
|
||||||
install(
|
install(
|
||||||
TARGETS ${LIBNAME}
|
TARGETS ${LIBNAME}
|
||||||
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||||
@ -45,6 +44,6 @@ install(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (ENABLE_TESTS)
|
if (ENABLE_TESTS)
|
||||||
add_subdirectory(testsuite)
|
add_subdirectory(testsuite)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user