From: <ai...@us...> - 2013-07-28 04:20:18
|
Revision: 12438 http://sourceforge.net/p/plplot/code/12438 Author: airwin Date: 2013-07-28 04:20:14 +0000 (Sun, 28 Jul 2013) Log Message: ----------- First working version that configures template.bp.in to create a number of different */bp.cmake build_package configurations for GTK+ component builds as documented in the README file. This version has created a libffi/bp.cmake file that configures the libffit build correctly, but glib/bp.cmake needs additional configuration to account for a required CFLAGS option. Modified Paths: -------------- trunk/cmake/build_projects/configure_bp.cmake Added Paths: ----------- trunk/cmake/build_projects/template.bp.in Modified: trunk/cmake/build_projects/configure_bp.cmake =================================================================== --- trunk/cmake/build_projects/configure_bp.cmake 2013-07-28 04:02:04 UTC (rev 12437) +++ trunk/cmake/build_projects/configure_bp.cmake 2013-07-28 04:20:14 UTC (rev 12438) @@ -9,22 +9,38 @@ math(EXPR max_index "(${nlines}/${group_size}) - 1") foreach(index RANGE 0 ${max_index}) list(GET lines 0 package) - message("${package}") list(GET lines 1 config_type) - message("${config_type}") list(GET lines 2 config_arguments) - message("${config_arguments}") list(GET lines 3 download_hash_type) - message("${download_hash_type}") list(GET lines 4 download_hash) - message("${download_hash}") list(GET lines 5 download_href) - message("${download_href}") list(GET lines 6 dependencies) - message("${dependencies}") list(GET lines 7 suggests) - message("${suggests}") list(GET lines 8 after) - message("${after}") list(REMOVE_AT lines ${remove_indices}) + + # Turn colon-separated lists into official CMake lists. + string(REGEX REPLACE ":" ";" dependencies "${dependencies}") + string(REGEX REPLACE ":" ";" suggests "${suggests}") + string(REGEX REPLACE ":" ";" after "${after}") + + # For now, ignore "after" and treat "dependencies" and "suggests" the same + if(suggests) + list(APPEND dependencies "${suggests}") + endif(suggests) + + # Configure the package file using the appropriate template file. + if(config_type STREQUAL "autotools" OR config_type STREQUAL "tarball" OR config_type STREQUAL "cmake") + set(template_file template.bp.in) + else(config_type STREQUAL "autotools" OR config_type STREQUAL "tarball" OR config_type STREQUAL "cmake") + message(FATAL_ERROR "incorrect config_type = ${config_type}") + endif(config_type STREQUAL "autotools" OR config_type STREQUAL "tarball" OR config_type STREQUAL "cmake") + + if(NOT package) + message(FATAL_ERROR "bad package = ${package}") + endif(NOT package) + + file(MAKE_DIRECTORY ${package}) + configure_file(${template_file} ${package}/bp.cmake @ONLY) + endforeach(index RANGE 0 ${max_index}) Added: trunk/cmake/build_projects/template.bp.in =================================================================== --- trunk/cmake/build_projects/template.bp.in (rev 0) +++ trunk/cmake/build_projects/template.bp.in 2013-07-28 04:20:14 UTC (rev 12438) @@ -0,0 +1,77 @@ +# @package@/bp.cmake +# This file should be included directly or indirectly from a top-level +# CMakeLists.txt file to configure the build of @package@. + +# 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. + +# Protect against configuring a build twice in one CMake call +if(@package@_configured) + return() +endif(@package@_configured) +set(@package@_configured ON) + +set(@package@_dependencies_LIST @dependencies@) + +foreach(build_configuration ${@package@_dependencies_LIST}) + include(${build_configuration}/bp.cmake) +endforeach(build_configuration ${@package@_dependences_LIST}) + +# This can be safely done only after above includes. +set(BP_PACKAGE @package@) + +set(${BP_PACKAGE}_dependencies_targets) +foreach(build_configuration ${${BP_PACKAGE}_dependencies_LIST}) + list(APPEND ${BP_PACKAGE}_dependencies_targets build_${build_configuration}) +endforeach(build_configuration ${${BP_PACKAGE}_dependences_LIST}) + +# Data that is related to downloads. +set(${BP_PACKAGE}_URL @download_href@) +set(${BP_PACKAGE}_DOWNLOAD_HASH_TYPE @download_hash_type@) +set(${BP_PACKAGE}_DOWNLOAD_HASH @download_hash@) + +# 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}") +else(MSYS_PLATFORM) + set(source_PATH "${EP_BASE}/Source/build_${BP_PACKAGE}") +endif(MSYS_PLATFORM) +#message(STATUS "modified BP_PATH for ${BP_PACKAGE} = ${BP_PATH}") + +ExternalProject_Add( + build_${BP_PACKAGE} + DEPENDS ${${BP_PACKAGE}_dependencies_targets} + URL ${${BP_PACKAGE}_URL} + URL_HASH ${${BP_PACKAGE}_DOWNLOAD_HASH_TYPE}=${${BP_PACKAGE}_DOWNLOAD_HASH} + CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${source_PATH}/${BP_CONFIGURE_COMMAND} + BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} + INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} install + ) + +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. |