mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-18 00:15:27 +01:00
adaptation cmake scripts to current MinGW platform (exclude SSL/Crypto/MySQL/Apache/ODBC)
This commit is contained in:
parent
680ce5e93e
commit
2c304d744d
@ -41,13 +41,34 @@ include(contrib/cmake/FindApache2.cmake)
|
||||
|
||||
# OS Detection
|
||||
if(CMAKE_SYSTEM MATCHES "Windows")
|
||||
add_definitions( -DPOCO_OS_FAMILY_WINDOWS)
|
||||
else (CMAKE_SYSTEM MATCHES "Windows")
|
||||
add_definitions( -DPOCO_OS_FAMILY_UNIX )
|
||||
add_definitions( -DPOCO_OS_FAMILY_WINDOWS -DPOCO_WIN32_UTF8)
|
||||
set(SYSLIBS iphlpapi gdi32)
|
||||
endif(CMAKE_SYSTEM MATCHES "Windows")
|
||||
|
||||
# Standard 'must be' defines
|
||||
add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 )
|
||||
if (CMAKE_SYSTEM MATCHES "Linux")
|
||||
add_definitions( -DPOCO_OS_FAMILY_UNIX )
|
||||
# Standard 'must be' defines
|
||||
add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 )
|
||||
set(SYSLIBS "pthread dl rt")
|
||||
endif(CMAKE_SYSTEM MATCHES "Linux")
|
||||
|
||||
if (CMAKE_SYSTEM MATCHES "SunOS")
|
||||
add_definitions( -DPOCO_OS_FAMILY_UNIX )
|
||||
# Standard 'must be' defines
|
||||
add_definitions( -D_XOPEN_SOURCE=500 -D_REENTRANT -D_THREAD_SAFE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 )
|
||||
set(SYSLIBS std15D pthread rt nsl dl)
|
||||
endif(CMAKE_SYSTEM MATCHES "SunOS")
|
||||
|
||||
if (CMAKE_COMPILER_IS_MINGW)
|
||||
add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400)
|
||||
add_definitions(-mno-cygwin -D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED )
|
||||
link_directories(/usr/local/lib /usr/lib)
|
||||
include_directories(/usr/local/include /usr/include)
|
||||
endif (CMAKE_COMPILER_IS_MINGW)
|
||||
|
||||
if (CMAKE_COMPILER_IS_CYGWIN)
|
||||
# add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400)
|
||||
endif (CMAKE_COMPILER_IS_CYGWIN)
|
||||
|
||||
add_subdirectory(CppUnit)
|
||||
add_subdirectory(Foundation)
|
||||
|
@ -15,5 +15,5 @@ set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoMySQL PocoData PocoFoundation CppUnit pthread)
|
||||
target_link_libraries( ${TESTUNIT} PocoMySQL PocoData PocoFoundation CppUnit )
|
||||
|
||||
|
@ -14,5 +14,5 @@ set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoSQLite PocoData PocoFoundation CppUnit pthread)
|
||||
target_link_libraries( ${TESTUNIT} PocoSQLite PocoData PocoFoundation CppUnit )
|
||||
|
||||
|
@ -21,5 +21,5 @@ set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoData PocoFoundation CppUnit pthread)
|
||||
target_link_libraries( ${TESTUNIT} PocoData PocoFoundation CppUnit)
|
||||
|
||||
|
@ -164,7 +164,6 @@ set( BASE_SRCS
|
||||
src/zutil.c
|
||||
)
|
||||
|
||||
|
||||
set(WIN_SRCS
|
||||
src/EventLogChannel.cpp
|
||||
src/WindowsConsoleChannel.cpp
|
||||
@ -182,23 +181,19 @@ else (CMAKE_SYSTEM MATCHES "Windows")
|
||||
add_definitions( -DPCRE_STATIC)
|
||||
endif(CMAKE_SYSTEM MATCHES "Windows")
|
||||
|
||||
#add_library( PocoFoundation ${SRCS} )
|
||||
#set_target_properties( PocoFoundation PROPERTIES COMPILE_FLAGS ${RELEASE_CPPFLAGS} )
|
||||
#target_link_libraries( PocoFoundation pthread)
|
||||
|
||||
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAME}
|
||||
PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS}
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAME} dl rt)
|
||||
target_link_libraries( ${LIBNAME} ${SYSLIBS})
|
||||
|
||||
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAMED}
|
||||
PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}"
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAMED} dl rt)
|
||||
target_link_libraries( ${LIBNAMED} ${SYSLIBS})
|
||||
|
||||
install(
|
||||
DIRECTORY include/Poco
|
||||
|
@ -1,4 +1,4 @@
|
||||
set(SAMPLE_NAME "String>Tokenizer")
|
||||
set(SAMPLE_NAME "StringTokenizer")
|
||||
|
||||
set(LOCAL_SRCS "")
|
||||
aux_source_directory(src LOCAL_SRCS)
|
||||
|
@ -11,6 +11,7 @@ set( LIN_SRCS
|
||||
|
||||
if(CMAKE_SYSTEM MATCHES "Windows")
|
||||
set(SRCS ${BASE_SRCS} ${WIN_SRCS})
|
||||
set(SYSLIBS ${SYSLIBS} ws2_32)
|
||||
else (CMAKE_SYSTEM MATCHES "Windows")
|
||||
set(SRCS ${BASE_SRCS} ${LIN_SRCS})
|
||||
endif(CMAKE_SYSTEM MATCHES "Windows")
|
||||
@ -24,14 +25,14 @@ set_target_properties( ${LIBNAME}
|
||||
PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS}
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAME} PocoFoundation)
|
||||
target_link_libraries( ${LIBNAME} PocoFoundation ${SYSLIBS})
|
||||
|
||||
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAMED}
|
||||
PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}"
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAMED} PocoFoundationd)
|
||||
target_link_libraries( ${LIBNAMED} PocoFoundationd ${SYSLIBS})
|
||||
|
||||
install(
|
||||
DIRECTORY include/Poco
|
||||
|
@ -65,5 +65,5 @@ set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoNet PocoUtil PocoXML PocoFoundation CppUnit pthread)
|
||||
target_link_libraries( ${TESTUNIT} PocoNet PocoUtil PocoXML PocoFoundation CppUnit)
|
||||
|
||||
|
@ -21,5 +21,5 @@ set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoNetSSL PocoNet PocoUtil PocoXML PocoFoundation CppUnit pthread)
|
||||
target_link_libraries( ${TESTUNIT} PocoNetSSL PocoNet PocoUtil PocoXML PocoFoundation CppUnit)
|
||||
|
||||
|
@ -45,14 +45,14 @@ set_target_properties( ${LIBNAME}
|
||||
PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS}
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAME} )
|
||||
target_link_libraries( ${LIBNAME} PocoXML PocoFoundation)
|
||||
|
||||
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAMED}
|
||||
PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}"
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAMED} )
|
||||
target_link_libraries( ${LIBNAMED} PocoXMLd PocoFoundationd )
|
||||
|
||||
install(
|
||||
DIRECTORY include/Poco
|
||||
|
@ -32,4 +32,4 @@ set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoUtil PocoXML PocoFoundation CppUnit pthread)
|
||||
target_link_libraries( ${TESTUNIT} PocoUtil PocoXML PocoFoundation CppUnit)
|
||||
|
@ -9,14 +9,14 @@ set_target_properties( ${LIBNAME}
|
||||
PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS}
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAME} PocoFoundation )
|
||||
target_link_libraries( ${LIBNAME} PocoNet PocoUtil PocoXML PocoFoundation )
|
||||
|
||||
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAMED}
|
||||
PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}"
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAMED} PocoFoundationd )
|
||||
target_link_libraries( ${LIBNAMED} PocoNetd PocoUtild PocoXMLd PocoFoundationd )
|
||||
|
||||
install(
|
||||
DIRECTORY include/Poco
|
||||
|
@ -14,5 +14,5 @@ set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoWebWidgets PocoNet PocoUtil PocoXML PocoFoundation CppUnit pthread)
|
||||
target_link_libraries( ${TESTUNIT} PocoWebWidgets PocoNet PocoUtil PocoXML PocoFoundation CppUnit)
|
||||
|
||||
|
@ -10,14 +10,14 @@ set_target_properties( ${LIBNAME}
|
||||
PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS}
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAME} )
|
||||
target_link_libraries( ${LIBNAME} PocoFoundation)
|
||||
|
||||
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAMED}
|
||||
PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}"
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAMED} )
|
||||
target_link_libraries( ${LIBNAMED} PocoFoundationd)
|
||||
|
||||
install(
|
||||
DIRECTORY include/Poco
|
||||
|
@ -32,5 +32,5 @@ set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoXML PocoFoundation CppUnit pthread)
|
||||
target_link_libraries( ${TESTUNIT} PocoXML PocoFoundation CppUnit)
|
||||
|
||||
|
@ -8,14 +8,14 @@ set_target_properties( ${LIBNAME}
|
||||
PROPERTIES COMPILE_FLAGS ${DEBUG_CXX_FLAGS}
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAME} )
|
||||
target_link_libraries( ${LIBNAME} PocoUtil PocoXML PocoFoundation)
|
||||
|
||||
add_library( ${LIBNAMED} ${LIB_MODE} ${SRCS} )
|
||||
set_target_properties( ${LIBNAMED}
|
||||
PROPERTIES COMPILE_FLAGS "${RELEASE_CXX_FLAGS}"
|
||||
VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
|
||||
SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
|
||||
target_link_libraries( ${LIBNAMED} )
|
||||
target_link_libraries( ${LIBNAMED} PocoUtild PocoXMLd PocoFoundationd)
|
||||
|
||||
install(
|
||||
DIRECTORY include/Poco
|
||||
|
@ -16,5 +16,5 @@ set(TESTUNIT "${LIBNAME}-testrunner")
|
||||
|
||||
add_executable( ${TESTUNIT} ${TEST_SRCS} )
|
||||
set_target_properties( ${TESTUNIT} PROPERTIES COMPILE_FLAGS ${RELEASE_CXX_FLAGS} )
|
||||
target_link_libraries( ${TESTUNIT} PocoZip PocoNet PocoFoundation CppUnit pthread)
|
||||
target_link_libraries( ${TESTUNIT} PocoZip PocoNet PocoFoundation CppUnit )
|
||||
|
||||
|
@ -51,5 +51,5 @@ if (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)
|
||||
include_directories(${MYSQL_INCLUDE_DIR})
|
||||
link_directories(${MYSQL_LIB_DIR})
|
||||
else (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)
|
||||
message(STATUS "Cannot find MySQL, include directory: ${MYSQL_INCLUDE_DIR} library directory: ${MYSQL_LIB_DIR}")
|
||||
message(STATUS "Couldn't find MySQL")
|
||||
endif (MYSQL_INCLUDE_DIR AND MYSQL_LIB_DIR)
|
||||
|
Loading…
x
Reference in New Issue
Block a user