1
# -*- mode: makefile; coding: utf-8 -*-
2
# Copyright (C) 2006 Peter Rockai <me@mornfall.net>
3
# Copyright (C) 2006 Fathi Boudra <fboudra@free.fr>
4
# Description: A class for cmake packages
6
# This program is free software; you can redistribute it and/or
7
# modify it under the terms of the GNU General Public License as
8
# published by the Free Software Foundation; either version 2, or (at
9
# your option) any later version.
11
# This program is distributed in the hope that it will be useful, but
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
# General Public License for more details.
16
# You should have received a copy of the GNU General Public License
17
# along with this program; if not, write to the Free Software
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21
ifndef _cdbs_bootstrap
22
_cdbs_scripts_path ?= /usr/lib/cdbs
23
_cdbs_rules_path ?= /usr/share/cdbs/1/rules
24
_cdbs_class_path ?= /usr/share/cdbs/1/class
27
ifndef _cdbs_class_cmake
28
_cdbs_class_cmake := 1
30
include $(_cdbs_rules_path)/buildcore.mk$(_cdbs_makefile_suffix)
32
ifdef _cdbs_tarball_dir
33
DEB_BUILDDIR = $(_cdbs_tarball_dir)/obj-$(DEB_BUILD_GNU_TYPE)
35
DEB_BUILDDIR = obj-$(DEB_BUILD_GNU_TYPE)
38
DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(DEB_DESTDIR)
39
DEB_CMAKE_PREFIX =/usr
41
# Overriden from makefile-vars.mk
42
# We pass CFLAGS and friends to ./configure, so no need to pass them to make
43
DEB_MAKE_INVOKE = $(DEB_MAKE_ENVVARS) $(MAKE) -C $(DEB_BUILDDIR)
45
include $(_cdbs_class_path)/makefile.mk$(_cdbs_makefile_suffix)
47
common-configure-arch common-configure-indep:: common-configure-impl
48
common-configure-impl:: $(DEB_BUILDDIR)/CMakeCache.txt
49
$(DEB_BUILDDIR)/CMakeCache.txt:
50
cd $(DEB_BUILDDIR) && cmake $(CURDIR)/$(DEB_SRCDIR) \
51
-DCMAKE_INSTALL_PREFIX="$(DEB_CMAKE_PREFIX)" \
52
$(DEB_CMAKE_EXTRA_FLAGS) -DCMAKE_CXX_FLAGS="$(CXXFLAGS)" \
53
-DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_VERBOSE_MAKEFILE=ON
54
mkdir -p $(DEB_DESTDIR)
57
-if test "$(DEB_BUILDDIR)" != "$(DEB_SRCDIR)"; then rm -rf $(DEB_BUILDDIR); fi