From ac73265fb3dc9186805997f7019c4041b702a48b Mon Sep 17 00:00:00 2001 From: Marian Krivos Date: Tue, 7 Feb 2012 13:56:54 +0000 Subject: [PATCH] trunk: cmake: added simple build script for building Release & Debug version at once --- CMakeLists.txt | 9 +++++---- build_cmake.sh | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) create mode 100755 build_cmake.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a95ed09f..b05b2b6a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,11 +82,11 @@ ELSE () message(STATUS "Building without tests & samples") ENDIF () -IF (!POCO_UNBUNDLED) - message(STATUS "Build with using internal copy of sqlite, libz, pcre, expat, ...") -ELSE () - add_definitions( -DPOCO_UNBUNDLED) +IF (POCO_UNBUNDLED) + add_definitions( -DPOCO_UNBUNDLED) message(STATUS "Build with using external sqlite, libz, pcre, expat ...") +ELSE () + message(STATUS "Build with using internal copy of sqlite, libz, pcre, expat, ...") ENDIF () # Set local include path @@ -191,6 +191,7 @@ SET(CPACK_PACKAGE_INSTALL_DIRECTORY "/usr/local") INCLUDE(CPack) message(STATUS "CMake ${CMAKE_VERSION} successfully configured ${PROJECT_NAME} using ${CMAKE_GENERATOR} generator") +message(STATUS "Installation target path: ${CMAKE_INSTALL_PREFIX}") message(STATUS "C_FLAGS: =${CMAKE_C_FLAGS}") message(STATUS "CXX_FLAGS:=${CMAKE_CXX_FLAGS}") diff --git a/build_cmake.sh b/build_cmake.sh new file mode 100755 index 000000000..3c3631625 --- /dev/null +++ b/build_cmake.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +# POCO_STATIC=1 - for static build +# POCO_UNBUNDLED - for no built-in version of libs +# CMAKE_INSTALL_PREFIX=path - for install path + +rm -rf cmake-build +mkdir cmake-build +cd cmake-build + +cmake ../. -DCMAKE_BUILD_TYPE=Debug $1 $2 $3 $4 $5 +make -j3 +make install + +rm -rf CMakeCache.txt + +cmake ../. $1 $2 $3 $4 $5 +make -j3 +make install + + +cd ..