diff --git a/CMakeModules/download_cairo.cmake b/CMakeModules/download_cairo.cmake new file mode 100644 index 0000000000..c8c6fa7db5 --- /dev/null +++ b/CMakeModules/download_cairo.cmake @@ -0,0 +1,81 @@ +# This program source code file is part of KICAD, a free EDA CAD application. +# +# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck +# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, you may find one here: +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# or you may search the http://www.gnu.org website for the version 2 license, +# or you may write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +# Downloads and builds CAIRO + +#--------------------------------------------------------------------- + +set( CAIRO_RELEASE 1.12.0 ) +set( CAIRO_MD5 e6c85575ba7094f88b637bdfd835a751 ) # re-calc this on every RELEASE change + +# The boost headers [and static libs if built] go here, at the top of KiCad +# source tree in boost_root. +set( CAIRO_ROOT "${PROJECT_SOURCE_DIR}/cairo_root" ) + +#-------------------------------------------------------------------- + +find_package( BZip2 REQUIRED ) + +set( PREFIX ${DOWNLOAD_DIR}/cairo ) + +if (APPLE) + if( CMAKE_OSX_ARCHITECTURES ) + set( CAIRO_CFLAGS "CFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES} -isysroot ${CMAKE_OSX_SYSROOT} -fno-lto" ) + set( CAIRO_LDFLAGS "LDFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES} -framework CoreGraphics -framework CoreServices" ) + set( CAIRO_OPTS "--enable-quartz-image" ) + endif( CMAKE_OSX_ARCHITECTURES ) +endif(APPLE) + +# = ${PREFIX}/src/glew +# There is a Bazaar 'boost scratch repo' in /boost and after committing pristine +# download, the patch is applied. This lets you regenerate a new patch at any time +# easily, simply by editing the working tree in and doing "bzr diff" in there. + +ExternalProject_Add( cairo + PREFIX "${PREFIX}" + DOWNLOAD_DIR "${DOWNLOAD_DIR}" + URL http://cairographics.org/releases/cairo-${CAIRO_RELEASE}.tar.gz + URL_MD5 ${CAIRO_MD5} + STAMP_DIR "${PREFIX}" + + DEPENDS pkgconfig pixman libpng + + BUILD_IN_SOURCE 1 + #SOURCE_DIR "${PREFIX}" + #PATCH_COMMAND "" + + CONFIGURE_COMMAND ./configure --prefix=${CAIRO_ROOT} --enable-static --disable-shared + PKG_CONFIG=${PROJECT_SOURCE_DIR}/pkgconfig_root/bin/pkg-config + PKG_CONFIG_PATH=${PROJECT_SOURCE_DIR}/pixman_root/lib/pkgconfig:${PROJECT_SOURCE_DIR}/libpng_root/lib/pkgconfig + --enable-png=yes --enable-svg=yes + --disable-silent-rules + ${CAIRO_CFLAGS} + ${CAIRO_LDFLAGS} + CC=${CMAKE_C_COMPILER} + + #BINARY_DIR "${PREFIX}" + + BUILD_COMMAND make + + INSTALL_DIR "${CAIRO_ROOT}" + INSTALL_COMMAND make install + ) diff --git a/CMakeModules/download_glew.cmake b/CMakeModules/download_glew.cmake new file mode 100644 index 0000000000..6e02a5b79e --- /dev/null +++ b/CMakeModules/download_glew.cmake @@ -0,0 +1,72 @@ +# This program source code file is part of KICAD, a free EDA CAD application. +# +# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck +# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, you may find one here: +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# or you may search the http://www.gnu.org website for the version 2 license, +# or you may write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +# Downloads and builds GLEW + +#--------------------------------------------------------------------- + +set( GLEW_RELEASE 1.10.0 ) +set( GLEW_MD5 2f09e5e6cb1b9f3611bcac79bc9c2d5d ) # re-calc this on every RELEASE change + +# The boost headers [and static libs if built] go here, at the top of KiCad +# source tree in boost_root. +set( GLEW_ROOT "${PROJECT_SOURCE_DIR}/glew_root" ) + +#-------------------------------------------------------------------- + +find_package( BZip2 REQUIRED ) + +set( PREFIX ${DOWNLOAD_DIR}/glew ) + +if (APPLE) + if( CMAKE_OSX_ARCHITECTURES ) + set( GLEW_CFLAGS "CFLAGS.EXTRA=-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.5" ) + set( GLEW_LDFLAGS "LDFLAGS.EXTRA=-arch ${CMAKE_OSX_ARCHITECTURES} -mmacosx-version-min=10.5" ) + set( GLEW_STRIP "STRIP=") + endif( CMAKE_OSX_ARCHITECTURES ) +endif(APPLE) + +# = ${PREFIX}/src/glew +# There is a Bazaar 'boost scratch repo' in /boost and after committing pristine +# download, the patch is applied. This lets you regenerate a new patch at any time +# easily, simply by editing the working tree in and doing "bzr diff" in there. + +ExternalProject_Add( glew + PREFIX "${PREFIX}" + DOWNLOAD_DIR "${DOWNLOAD_DIR}" + URL http://sourceforge.net/projects/glew/files/glew/1.10.0/glew-${GLEW_RELEASE}.tgz + URL_MD5 ${GLEW_MD5} + STAMP_DIR "${PREFIX}" + + #SOURCE_DIR "${PREFIX}" + BUILD_IN_SOURCE 1 + + #PATCH_COMMAND "true" + CONFIGURE_COMMAND "" + + #BINARY_DIR "${PREFIX}" + + BUILD_COMMAND make ${GLEW_CFLAGS} ${GLEW_LDFLAGS} ${GLEW_STRIP} + + INSTALL_DIR "${GLEW_ROOT}" + INSTALL_COMMAND make GLEW_DEST="${GLEW_ROOT}" install && ranlib "${GLEW_ROOT}/lib/libGLEW.a" + ) diff --git a/CMakeModules/download_libpng.cmake b/CMakeModules/download_libpng.cmake new file mode 100644 index 0000000000..93074f6848 --- /dev/null +++ b/CMakeModules/download_libpng.cmake @@ -0,0 +1,69 @@ +# This program source code file is part of KICAD, a free EDA CAD application. +# +# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck +# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, you may find one here: +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# or you may search the http://www.gnu.org website for the version 2 license, +# or you may write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +# Downloads and builds LIBPNG + +#--------------------------------------------------------------------- + +set( LIBPNG_RELEASE 1.4.12 ) +set( LIBPNG_MD5 849b14d88e1240a1b9f2cb39dd39701e ) # re-calc this on every RELEASE change + +# The boost headers [and static libs if built] go here, at the top of KiCad +# source tree in boost_root. +set( LIBPNG_ROOT "${PROJECT_SOURCE_DIR}/libpng_root" ) + +#-------------------------------------------------------------------- + +find_package( BZip2 REQUIRED ) + +set( PREFIX ${DOWNLOAD_DIR}/libpng ) + +if (APPLE) + if( CMAKE_OSX_ARCHITECTURES ) + SET( LIBPNG_CFLAGS "CFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES}") + endif( CMAKE_OSX_ARCHITECTURES ) +endif(APPLE) + +# = ${PREFIX}/src/glew +# There is a Bazaar 'boost scratch repo' in /boost and after committing pristine +# download, the patch is applied. This lets you regenerate a new patch at any time +# easily, simply by editing the working tree in and doing "bzr diff" in there. + +ExternalProject_Add( libpng + PREFIX "${PREFIX}" + DOWNLOAD_DIR "${DOWNLOAD_DIR}" + URL http://sourceforge.net/projects/libpng/files/libpng14/${LIBPNG_RELEASE}/libpng-${LIBPNG_RELEASE}.tar.bz2 + URL_MD5 ${LIBPNG_MD5} + STAMP_DIR "${PREFIX}" + + #SOURCE_DIR "${PREFIX}" + BUILD_IN_SOURCE 1 + + #PATCH_COMMAND "true" + CONFIGURE_COMMAND ./configure --prefix=${LIBPNG_ROOT} --enable-static --disable-shared ${LIBPNG_CFLAGS} + #BINARY_DIR "${PREFIX}" + + BUILD_COMMAND make + + INSTALL_DIR "${LIBPNG_ROOT}" + INSTALL_COMMAND make install + ) diff --git a/CMakeModules/download_pixman.cmake b/CMakeModules/download_pixman.cmake new file mode 100644 index 0000000000..34981d44d9 --- /dev/null +++ b/CMakeModules/download_pixman.cmake @@ -0,0 +1,69 @@ +# This program source code file is part of KICAD, a free EDA CAD application. +# +# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck +# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, you may find one here: +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# or you may search the http://www.gnu.org website for the version 2 license, +# or you may write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +# Downloads and builds PIXMAN + +#--------------------------------------------------------------------- + +set( PIXMAN_RELEASE 0.32.4 ) +set( PIXMAN_MD5 eba449138b972fbf4547a8c152fea162 ) # re-calc this on every RELEASE change + +# The boost headers [and static libs if built] go here, at the top of KiCad +# source tree in boost_root. +set( PIXMAN_ROOT "${PROJECT_SOURCE_DIR}/pixman_root" ) + +#-------------------------------------------------------------------- + +find_package( BZip2 REQUIRED ) + +set( PREFIX ${DOWNLOAD_DIR}/pixman ) + +if (APPLE) + if( CMAKE_OSX_ARCHITECTURES ) + set(PIXMAN_CPPFLAGS "CFLAGS=-arch ${CMAKE_OSX_ARCHITECTURES} -fno-common -mmacosx-version-min=10.5") + endif( CMAKE_OSX_ARCHITECTURES ) +endif(APPLE) + +# = ${PREFIX}/src/glew +# There is a Bazaar 'boost scratch repo' in /boost and after committing pristine +# download, the patch is applied. This lets you regenerate a new patch at any time +# easily, simply by editing the working tree in and doing "bzr diff" in there. + +ExternalProject_Add( pixman + PREFIX "${PREFIX}" + DOWNLOAD_DIR "${DOWNLOAD_DIR}" + URL http://cairographics.org/releases/pixman-${PIXMAN_RELEASE}.tar.gz + URL_MD5 ${PIXMAN_MD5} + STAMP_DIR "${PREFIX}" + + #SOURCE_DIR "${PREFIX}" + BUILD_IN_SOURCE 1 + + #PATCH_COMMAND "true" + CONFIGURE_COMMAND ./configure --prefix=${PIXMAN_ROOT} --enable-static=yes --enable-shared=no ${PIXMAN_CPPFLAGS} CC=${CMAKE_C_COMPILER} + #BINARY_DIR "${PREFIX}" + + BUILD_COMMAND make + + INSTALL_DIR "${PIXMAN_ROOT}" + INSTALL_COMMAND make install + ) diff --git a/CMakeModules/download_pkgconfig.cmake b/CMakeModules/download_pkgconfig.cmake new file mode 100644 index 0000000000..251a499e90 --- /dev/null +++ b/CMakeModules/download_pkgconfig.cmake @@ -0,0 +1,63 @@ +# This program source code file is part of KICAD, a free EDA CAD application. +# +# Copyright (C) 2013 SoftPLC Corporation, Dick Hollenbeck +# Copyright (C) 2013 Kicad Developers, see AUTHORS.txt for contributors. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, you may find one here: +# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html +# or you may search the http://www.gnu.org website for the version 2 license, +# or you may write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + +# Downloads and builds CAIRO + +#--------------------------------------------------------------------- + +set( PKGCONFIG_RELEASE 0.28 ) +set( PKGCONFIG_MD5 aa3c86e67551adc3ac865160e34a2a0d ) # re-calc this on every RELEASE change + +# The boost headers [and static libs if built] go here, at the top of KiCad +# source tree in boost_root. +set( PKGCONFIG_ROOT "${PROJECT_SOURCE_DIR}/pkgconfig_root" ) + +#-------------------------------------------------------------------- + +find_package( BZip2 REQUIRED ) + +set( PREFIX ${DOWNLOAD_DIR}/pkgconfig ) + +# = ${PREFIX}/src/glew +# There is a Bazaar 'boost scratch repo' in /boost and after committing pristine +# download, the patch is applied. This lets you regenerate a new patch at any time +# easily, simply by editing the working tree in and doing "bzr diff" in there. + +ExternalProject_Add( pkgconfig + PREFIX "${PREFIX}" + DOWNLOAD_DIR "${DOWNLOAD_DIR}" + URL http://pkgconfig.freedesktop.org/releases/pkg-config-${PKGCONFIG_RELEASE}.tar.gz + URL_MD5 ${PKGCONFIG_MD5} + STAMP_DIR "${PREFIX}" + + #SOURCE_DIR "${PREFIX}" + BUILD_IN_SOURCE 1 + + #PATCH_COMMAND "true" + CONFIGURE_COMMAND ./configure --prefix=${PKGCONFIG_ROOT} --with-internal-glib --enable-shared=no --enable-static=yes --disable-silent-rules + #BINARY_DIR "${PREFIX}" + + BUILD_COMMAND make + + INSTALL_DIR "${PKGCONFIG_ROOT}" + INSTALL_COMMAND make install + )