mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-26 10:21:08 +01:00
f442148670
For a unix system, this commit implies no changes by default. However, the ${LIB_SUFFIX} convention was added so the build can be configured for a red-hat style installation which uses lib64 by specifying cmake -DLIB_SUFFIX=64 For a windows build (msvc), this commit will cause the .dll files to be installed in the bin/ path; import libraries .lib are still installed in the lib/ path. Installing dlls into the bin path is preferable because dlls must be in the executable %PATH% to be found at runtime, as there is not equivalent of a separate library path as there is on unix.
59 lines
1.4 KiB
CMake
59 lines
1.4 KiB
CMake
set(LIBNAME "PocoData")
|
|
|
|
set(SRCS "")
|
|
aux_source_directory(src SRCS)
|
|
include_directories( SQLite/include )
|
|
|
|
if (NOT POCO_STATIC)
|
|
add_definitions(-DData_EXPORTS -DTHREADSAFE -DODBC_EXPORTS -DMySQL_EXPORTS -DSQLite_EXPORTS)
|
|
endif (NOT POCO_STATIC)
|
|
|
|
if(MSVC AND NOT(MSVC_VERSION LESS 1400))
|
|
set_source_files_properties(src/StatementImpl.cpp
|
|
PROPERTIES COMPILE_FLAGS "/bigobj")
|
|
endif()
|
|
|
|
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
|
set_target_properties( ${LIBNAME}
|
|
PROPERTIES
|
|
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
|
|
target_link_libraries( ${LIBNAME} PocoFoundation)
|
|
|
|
install(
|
|
DIRECTORY include/Poco
|
|
DESTINATION include
|
|
PATTERN ".svn" EXCLUDE
|
|
)
|
|
|
|
install(
|
|
TARGETS ${LIBNAME}
|
|
LIBRARY DESTINATION lib${LIB_SUFFIX}
|
|
ARCHIVE DESTINATION lib${LIB_SUFFIX}
|
|
RUNTIME DESTINATION bin
|
|
)
|
|
|
|
add_subdirectory( SQLite )
|
|
|
|
if(MYSQL_FOUND)
|
|
add_subdirectory( MySQL )
|
|
endif(MYSQL_FOUND)
|
|
|
|
include(FindODBC)
|
|
|
|
if(CMAKE_SYSTEM MATCHES "Windows")
|
|
message(STATUS "Windows native ODBC Support Enabled")
|
|
add_subdirectory( ODBC )
|
|
else ()
|
|
if ( ${UNIX_ODBC_CONFIG} STREQUAL UNIX_ODBC_CONFIG-NOTFOUND AND ${IODBC_CONFIG} STREQUAL IODBC_CONFIG-NOTFOUND)
|
|
message(STATUS "ODBC Support Disabled - no ODBC runtime")
|
|
else ()
|
|
message(STATUS "ODBC Support Enabled")
|
|
add_subdirectory( ODBC )
|
|
endif ()
|
|
endif()
|
|
|
|
if (ENABLE_TESTS)
|
|
add_subdirectory(samples)
|
|
add_subdirectory(testsuite)
|
|
endif ()
|