From: <ai...@us...> - 2013-07-15 19:43:19
|
Revision: 12424 http://sourceforge.net/p/plplot/code/12424 Author: airwin Date: 2013-07-15 19:43:05 +0000 (Mon, 15 Jul 2013) Log Message: ----------- Add a buildtools build configuration for pkg-config and propagate CMAKE_VERBOSE_MAKEFILE to build configurations. Tested by Alan W. Irwin <ai...@us...> using the build_pkg-config target for the "Unix Makefiles" (on Linux) and "MSYS Makefiles" (on Wine-1.6.rc4) CMake generators with -DBUILD_THE_BUILDTOOLS=ON Note, if you uncomment the test in pkg-config/bp.cmake, then all is well on Linux, but four of the tests fail on Wine. I have no idea how serious these test failures are, but I have created a bug report at <https://bugs.freedesktop.org/show_bug.cgi?id=66939> concerning these test failures. Modified Paths: -------------- trunk/cmake/build_projects/CMakeLists.txt Added Paths: ----------- trunk/cmake/build_projects/pkg-config/ trunk/cmake/build_projects/pkg-config/bp.cmake Modified: trunk/cmake/build_projects/CMakeLists.txt =================================================================== --- trunk/cmake/build_projects/CMakeLists.txt 2013-07-15 17:25:08 UTC (rev 12423) +++ trunk/cmake/build_projects/CMakeLists.txt 2013-07-15 19:43:05 UTC (rev 12424) @@ -136,11 +136,11 @@ determine_msys_path(BP_BUILD_COMMAND "${BP_BUILD_COMMAND}") determine_msys_path(BP_MAKE_COMMAND "${BP_MAKE_COMMAND}") determine_msys_path(BP_CTEST_COMMAND "${BP_CTEST_COMMAND}") - determine_msys_path(MSYS_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") + determine_msys_path(BP_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") determine_msys_path(MSYS_CMAKE_COMMAND "${CMAKE_COMMAND}") # Propagate the overall CMake generator and install prefix to all CMake-based # software project builds. - set(BP_CMAKE_COMMAND ${MSYS_CMAKE_COMMAND} "-G${CMAKE_GENERATOR}" -DCMAKE_INSTALL_PREFIX:PATH=${MSYS_CMAKE_INSTALL_PREFIX}) + set(BP_CMAKE_COMMAND ${MSYS_CMAKE_COMMAND} "-G${CMAKE_GENERATOR}" -DCMAKE_INSTALL_PREFIX:PATH=${BP_CMAKE_INSTALL_PREFIX}) # Propagate CMAKE_C_COMPILER, CMAKE_CXX_COMPILER, and # CMAKE_RC_COMPILER to all CMake-based software project builds. # (jom currently requires this as a workaround). @@ -157,15 +157,26 @@ list(APPEND BP_CMAKE_COMMAND -DCMAKE_RC_COMPILER:FILEPATH=${MSYS_CMAKE_RC_COMPILER}) endif(CMAKE_RC_COMPILER) # Propagate the install prefix to autotools-based builds - set(BP_CONFIGURE_COMMAND configure --prefix=${MSYS_CMAKE_INSTALL_PREFIX}) + set(BP_CONFIGURE_COMMAND configure --prefix=${BP_CMAKE_INSTALL_PREFIX}) else(MSYS_PLATFORM) # Propagate the overall CMake generator and install prefix to all CMake-based # software project builds. set(BP_CMAKE_COMMAND ${CMAKE_COMMAND} "-G${CMAKE_GENERATOR}" -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}) + set(BP_CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) # Propagate the install prefix to autotools-based builds - set(BP_CONFIGURE_COMMAND configure --prefix=${CMAKE_INSTALL_PREFIX}) + set(BP_CONFIGURE_COMMAND configure --prefix=${BP_CMAKE_INSTALL_PREFIX}) endif(MSYS_PLATFORM) +if(CMAKE_VERBOSE_MAKEFILE) + # Not sure whether all contemplated back-ends support this or not, but + # most should. + list(APPEND BP_CMAKE_COMMAND -DCMAKE_VERBOSE_MAKEFILE=ON) + # Some autotools build projects give verbose make results when V=1 + # and I don't think it will interfere with the rest. + list(APPEND BP_MAKE_COMMAND V=1) +endif(CMAKE_VERBOSE_MAKEFILE) + + # The parallel versions are for software packages that # do not have race conditions for parallel builds or tests. set(BP_PARALLEL_BUILD_COMMAND "${BP_BUILD_COMMAND}" -j4) @@ -220,6 +231,8 @@ set(build_configuration_LIST cmake + pkg-config + #subversion ) else(BUILD_THE_BUILDTOOLS) # List of all configurations. Order doesn't matter because multiple @@ -232,6 +245,7 @@ plplot shapelib wxwidgets + #glib ) endif(BUILD_THE_BUILDTOOLS) Added: trunk/cmake/build_projects/pkg-config/bp.cmake =================================================================== --- trunk/cmake/build_projects/pkg-config/bp.cmake (rev 0) +++ trunk/cmake/build_projects/pkg-config/bp.cmake 2013-07-15 19:43:05 UTC (rev 12424) @@ -0,0 +1,80 @@ +# pkg-config/bp.cmake +# This file should be included directly or indirectly from a top-level +# CMakeLists.txt file to configure the build of pkg-config. + +# Copyright (C) 2013 Alan W. Irwin + +# This file is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with this file; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +# The top-level CMakeLists.txt file that includes this file should +# have run "include(ExternalProject)" and set EP_BASE variable (and +# corresponding directory property) as well as various BP variables +# used below that configure how the External_Project functions +# operate. + +set(BP_PACKAGE pkg-config) + +# Protect against configuring a build twice in one CMake call +if(${BP_PACKAGE}_configured) + return() +endif(${BP_PACKAGE}_configured) +set(${BP_PACKAGE}_configured ON) + +# Data that is related to downloads. +set(${BP_PACKAGE}_URL http://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz) +set(${BP_PACKAGE}_DOWNLOAD_HASH_TYPE MD5) +set(${BP_PACKAGE}_DOWNLOAD_HASH aa3c86e67551adc3ac865160e34a2a0d) + + +# Data that is related to the PATH that must be used. +if(MSYS_PLATFORM) + #set(BP_PATH_NODLL "${BP_PATH}") + #set(BP_PATH "${EP_BASE}/Build/build_${BP_PACKAGE}/dll;${BP_PATH_NODLL}") + determine_msys_path(BP_PATH "${BP_PATH}") + # Must have all elements of env command in MSYS platform form + determine_msys_path(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}") + # configure (for glib subpackage) dies without this. + set(${BP_PACKAGE}_SET_CFLAGS "CFLAGS=-march=native $ENV{CFLAGS}") +else(MSYS_PLATFORM) + set(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}") + set(${BP_PACKAGE}_SET_CFLAGS "CFLAGS=$ENV{CFLAGS}") +endif(MSYS_PLATFORM) +#message(STATUS "modified BP_PATH for ${BP_PACKAGE} = ${BP_PATH}") + +ExternalProject_Add( + build_${BP_PACKAGE} + URL ${${BP_PACKAGE}_URL} + URL_HASH ${${BP_PACKAGE}_DOWNLOAD_HASH_TYPE}=${${BP_PACKAGE}_DOWNLOAD_HASH} + CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${${BP_PACKAGE}_SET_CFLAGS} ${source_PATH}/${BP_CONFIGURE_COMMAND} --with-internal-glib + BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} +# 4 of 25 tests fail for the MinGW/MSYS/Wine platform so comment out +# the next two lines for now. +# TEST_BEFORE_INSTALL ON +# TEST_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} check + INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} install + ) + +ExternalProject_Add_Step( + build_${BP_PACKAGE} preinstall_fix + COMMENT "remove pkg-config binaries from the install tree" + DEPENDEES build + DEPENDERS install + COMMAND ${CMAKE_COMMAND} -DFILE_WILDCARD:STRING=${BP_CMAKE_INSTALL_PREFIX}/bin/*-pkg-config* -P ${CMAKE_SOURCE_DIR}/wildcard_remove.cmake + ) + +list(APPEND build_target_LIST build_${BP_PACKAGE}) +# Restore BP_PATH to original state. +set(BP_PATH "${BP_ORIGINAL_NATIVE_PATH}") +#message(STATUS "${BP_PACKAGE} restored original BP_PATH = ${BP_PATH}") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |