cmake: Cleanup CMakeLists.txt for all components

- Add missing CMakeLists.txt
- Use POCO_ macros to improve code structure in XCode/VisualStudio
- Better ODBC detection
- Remove unnecessary commented out code

The CMake documentation recommends explicitly listing source files, but because CMake is not the primary build system GLOB patterns are used for the moment.
This commit is contained in:
Pascal Bach
2014-08-22 17:10:24 +02:00
parent 65fcaf65a0
commit 7950001803
96 changed files with 630 additions and 1296 deletions

View File

@@ -1,19 +1,18 @@
set( TEST_SRCS
src/Driver.cpp
src/MySQLTest.cpp
src/MySQLTestSuite.cpp
src/SQLExecutor.cpp
)
#include_directories()
set( WIN_TEST_SRCS
src/WinDriver.cpp
)
set(TESTUNIT "${LIBNAME}-testrunner")
# Sources
file(GLOB SRCS_G "src/*.cpp")
POCO_SOURCES_AUTO( TEST_SRCS ${SRCS_G})
# Headers
file(GLOB_RECURSE HDRS_G "src/*.h" )
POCO_HEADERS_AUTO( TEST_SRCS ${HDRS_G})
POCO_SOURCES_AUTO_PLAT( TEST_SRCS WIN32
src/WinDriver.cpp
)
add_executable( ${TESTUNIT} ${TEST_SRCS} )
#set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
add_test(NAME ${LIBNAME} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ${TESTUNIT} -all)
target_link_libraries( ${TESTUNIT} PocoDataMySQL PocoData PocoFoundation CppUnit )