> It would be nice if you could consider using Cmake as your cross-platform build system. By using CMake you can automate building and installing across all platforms. Even KDE is now using CMake. Another plus with CMake is that it knows about IDEs and will generate the required files for them. Check it out at www.cmake.org.
>
>
> It is the best solution that we have found for cross-platform work. We develop in Linux, Windows XP and QNX.
I agree with him, cmake is quite elegant and easy.I take the opportunity to add my detection script for POCO and CMake integration:
!FindPoco.cmake
- Code: Select all
SET(POCO_DIR "poco")
FIND_PATH(POCO_INCLUDE_DIR Poco/Poco.h PATHS ${POCO_DIR}/include /usr/local/include /usr/include ENV INCLUDE DOC "POCO include directory")
FIND_LIBRARY(POCO_LIBRARY NAMES PocoFoundation PocoFoundationd PATHS ${POCO_DIR}/lib /usr/local/lib /usr/lib ${POCO_INCLUDE_DIR}/../lib ENV LIB)
FIND_LIBRARY(POCO_LIBRARYD NAMES PocoFoundationd PocoFoundation PATHS ${POCO_DIR}/lib /usr/local/lib /usr/lib ${POCO_INCLUDE_DIR}/../lib ENV LIB )
FIND_LIBRARY(POCO_NET_LIBRARY NAMES PocoNet PocoNetd PATHS ${POCO_DIR}/lib /usr/local/lib /usr/lib ${POCO_INCLUDE_DIR}/../lib ENV LIB )
FIND_LIBRARY(POCO_NET_LIBRARYD NAMES PocoNetd PocoNet PATHS ${POCO_DIR}/lib /usr/local/lib /usr/lib ${POCO_INCLUDE_DIR}/../lib ENV LIB )
FIND_LIBRARY(POCO_UTIL_LIBRARY NAMES PocoUtil PocoUtild PATHS ${POCO_DIR}/lib /usr/local/lib /usr/lib ${POCO_INCLUDE_DIR}/../lib ENV LIB )
FIND_LIBRARY(POCO_UTIL_LIBRARYD NAMES PocoUtild PocoUtil PATHS ${POCO_DIR}/lib /usr/local/lib /usr/lib ${POCO_INCLUDE_DIR}/../lib ENV LIB )
FIND_LIBRARY(POCO_XML_LIBRARY NAMES PocoXML PocoXMLd PATHS ${POCO_DIR}/lib /usr/local/lib /usr/lib ${POCO_INCLUDE_DIR}/../lib ENV LIB )
FIND_LIBRARY(POCO_XML_LIBRARYD NAMES PocoXMLd PocoXML PATHS ${POCO_DIR}/lib /usr/local/lib /usr/lib ${POCO_INCLUDE_DIR}/../lib ENV LIB )
IF (POCO_INCLUDE_DIR AND POCO_LIBRARY)
SET(POCO_FOUND TRUE)
ENDIF (POCO_INCLUDE_DIR AND POCO_LIBRARY)
To use it, simply add the following directives then in your 'CMakeList.txt'
- Code: Select all
LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/modules)
FIND_PACKAGE(Poco REQUIRED)
INCLUDE_DIRECTORIES ( ${POCO_INCLUDE_DIR} )
Where modules would be a directory where you have put the 'FindPoco.cmake' file, and for instance, to link your amazing application:
- Code: Select all
TARGET_LINK_LIBRARIES ( MY_APPLICATION
optimized ${POCO_LIBRARY}
debug ${POCO_LIBRARYD}
optimized ${POCO_NET_LIBRARY}
debug ${POCO_NET_LIBRARYD}
optimized ${POCO_UTIL_LIBRARY}
debug ${POCO_UTIL_LIBRARYD})
I use this for my compilations and was tested successfully under Linux, Solaris, MacOS and Win32 (under WIN32, just set POCO_DIR to the path where you installed poco before launching CMake Wizard).
Pierre
>
>
> Andrew