Overview
Features
Download
Documentation
Community
Add-Ons & Services

No CMake build?

Please post support and help requests here.

No CMake build?

Postby hbeck » 01 Jun 2012, 18:35

Hey, what gives? CMake build support in the library was a big factor in our choice to work with it. I realize that might not be true for a majority of folks, but still...why nuke it when it was working?

I did read the blog post (http://pocoproject.org/blog/?p=502) but didn't get any warm-fuzzy feeling after doing so about when the CMakeLists.txt files would return.

Just feels a bit like the rug was pulled out from under.


What're my options for building with CMake for now?
hbeck
 
Posts: 9
Joined: 14 Jul 2011, 22:22

Re: No CMake build?

Postby rmoffer » 04 Jun 2012, 19:18

We use CMake for everything and initially wrote our own CMakeLists.txt to drive the Poco build

As our (single) CMakeLists file became more unmanageable we made the decision to not try and replicate any third party's build instruction, but to use CMake's external_project() macro.

For example this is how we compile poco on Linux, Darwin and Windows

Code: Select all
# Don't need to build static libraries
SET(POCO_TARGET shared_release)

IF ( ${CMAKE_BUILD_TYPE} MATCHES "Debug" )

  SET(POCO_TARGET shared_debug)

ENDIF ( ${CMAKE_BUILD_TYPE} MATCHES "Debug" )

# Poco
IF (CMAKE_SYSTEM MATCHES "Linux")
ExternalProject_Add(
  ${POCO}
  PREFIX exports
  URL ${PROJECT_SOURCE_DIR}/lib/${POCO}
  UPDATE_COMMAND ""
  BUILD_IN_SOURCE 1
  CONFIGURE_COMMAND ../${POCO}/configure --no-samples --omit=Data/MySQL,Data/ODBC,Zip --cflags="-m32" --config=HLLinux32
  BUILD_COMMAND make DEFAULT_TARGET=${POCO_TARGET}
  TEST_BEFORE_INSTALL 1
  TEST_COMMAND make tests DEFAULT_TARGET=${POCO_TARGET}
  INSTALL_COMMAND make install DEFAULT_TARGET=${POCO_TARGET} INSTALLDIR="${PROJECT_BINARY_DIR}/exports"
)



INSTALL(
    FILES
        ${PROJECT_BINARY_DIR}/exports/lib/libPocoCrypto${DBG}.so.12
        ${PROJECT_BINARY_DIR}/exports/lib/libPocoData${DBG}.so.12
        ${PROJECT_BINARY_DIR}/exports/lib/libPocoDataSQLite${DBG}.so.12
        ${PROJECT_BINARY_DIR}/exports/lib/libPocoFoundation${DBG}.so.12
        ${PROJECT_BINARY_DIR}/exports/lib/libPocoNet${DBG}.so.12
        ${PROJECT_BINARY_DIR}/exports/lib/libPocoNetSSL${DBG}.so.12
        ${PROJECT_BINARY_DIR}/exports/lib/libPocoUtil${DBG}.so.12
        ${PROJECT_BINARY_DIR}/exports/lib/libPocoXML${DBG}.so.12

    DESTINATION lib
)

ELSEIF (CMAKE_SYSTEM MATCHES "Darwin")
ExternalProject_Add(
  ${POCO}
  PREFIX exports
  URL ${PROJECT_SOURCE_DIR}/lib/${POCO}
  UPDATE_COMMAND ""
  BUILD_IN_SOURCE 1
  CONFIGURE_COMMAND ../${POCO}/configure --omit=Data/MySQL,Data/ODBC,Zip --config=Darwin-clang
  BUILD_COMMAND make DEFAULT_TARGET=${POCO_TARGET}
  TEST_BEFORE_INSTALL 1
  TEST_COMMAND make tests DEFAULT_TARGET=${POCO_TARGET}
  INSTALL_COMMAND make install DEFAULT_TARGET=${POCO_TARGET} INSTALLDIR="${PROJECT_BINARY_DIR}/exports"
)


ELSEIF (CMAKE_SYSTEM MATCHES "Windows")

IF ( ${CMAKE_BUILD_TYPE} MATCHES "Debug" )
  SET( POCO_BUILD_TYPE debug )
ELSE ( ${CMAKE_BUILD_TYPE} MATCHES "Debug" )
  SET( POCO_BUILD_TYPE release )
ENDIF ( ${CMAKE_BUILD_TYPE} MATCHES "Debug" )

FILE(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} WINEXPORTS)

ExternalProject_Add(
  ${POCO}
  PREFIX exports
  URL ${PROJECT_SOURCE_DIR}/lib/${POCO}
  UPDATE_COMMAND ""
  BUILD_IN_SOURCE 1
  CONFIGURE_COMMAND ""
  BUILD_COMMAND buildwin.cmd 100 build shared ${POCO_BUILD_TYPE} Win32 nosamples
  TEST_BEFORE_INSTALL 1
  TEST_COMMAND ""
  INSTALL_COMMAND nmake /F Makefile.nmake install INSTALLDIR=${WINEXPORTS} POCO_TARGET=${POCO_TARGET}
)

ENDIF (CMAKE_SYSTEM MATCHES "Linux")



To be honest I'm not sure if an embedded CMakeLists.txt file helps us - some of the third party code we need has them and its no easier by the time that we "fix" it to work with our expectations....
rmoffer
 
Posts: 49
Joined: 09 Feb 2009, 19:20
Location: San Francisco bay area.

Re: No CMake build?

Postby alex » 04 Jun 2012, 19:41

hbeck wrote:What're my options for building with CMake for now?

CMake was never officially supported but we do not oppose it (or any other build system) being contributed to and distributed with POCO. The key is to have someone to actively maintain it.
alex
 
Posts: 1156
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests