2 |
# cmake config tools |
# cmake config tools |
3 |
|
|
4 |
SDEPEND="${SDEPEND} |
SDEPEND="${SDEPEND} |
5 |
>= dev-util/cmake-2.4.7" |
>= dev-util/cmake-2.4.7 |
6 |
|
>= virtual/sed" |
7 |
|
|
8 |
# enables features like --enable-blah with make |
# enables features like --enable-blah with make |
9 |
cmake_enable() |
cmake_enable() |
113 |
echo "-D${feature}=${option}" |
echo "-D${feature}=${option}" |
114 |
} |
} |
115 |
|
|
116 |
|
cmake_libsuffix() |
117 |
|
{ |
118 |
|
local libsuffix |
119 |
|
|
120 |
|
libsuffix="$(mlibdir)" |
121 |
|
libsuffix="${libsuffix/lib}" |
122 |
|
echo "${libsuffix}" |
123 |
|
} |
124 |
|
|
125 |
cmake_src_prepare() |
cmake_src_prepare() |
126 |
{ |
{ |
127 |
munpack ${SRCFILE} || die |
munpack ${SRCFILE} || die |
131 |
{ |
{ |
132 |
local configure_opts="$@" |
local configure_opts="$@" |
133 |
local default_opts |
local default_opts |
|
local libsuffix="$(mlibdir)" |
|
|
local libsuffix="${libsuffix/lib}" |
|
134 |
|
|
135 |
# disable colors if requested |
# disable colors if requested |
136 |
if [[ ${NOCOLORS} = true ]] |
if [[ ${NOCOLORS} = true ]] |
141 |
default_opts+=" -DCMAKE_VERBOSE_MAKEFILE=ON" |
default_opts+=" -DCMAKE_VERBOSE_MAKEFILE=ON" |
142 |
default_opts+=" -DCMAKE_BUILD_TYPE=Release" |
default_opts+=" -DCMAKE_BUILD_TYPE=Release" |
143 |
default_opts+=" -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr}" |
default_opts+=" -DCMAKE_INSTALL_PREFIX=${PREFIX:-/usr}" |
144 |
default_opts+=" -DLIB_SUFFIX=${libsuffix}" |
default_opts+=' -DLIB_SUFFIX=$(cmake_libsuffix)' |
145 |
default_opts+=' -DLIB_INSTALL_DIR=${PREFIX:-/usr}/$(mlibdir)' |
default_opts+=' -DLIB_INSTALL_DIR=${PREFIX:-/usr}/$(mlibdir)' |
146 |
|
|
147 |
if [[ ${MULTILIB_BUILD} = true ]] |
if [[ ${MULTILIB_BUILD} = true ]] |
154 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
155 |
do |
do |
156 |
cd ${BUILDDIR}/build-${abi} |
cd ${BUILDDIR}/build-${abi} |
157 |
cmake ${default_opts} ${configure_opts} ${SRCDIR}-${abi}/${SRCSUBDIR} || die |
abi-${abi} cmake ${default_opts} ${configure_opts} ${SRCDIR}-${abi}/${SRCSUBDIR} || die |
158 |
done |
done |
159 |
else |
else |
160 |
cd ${BUILDDIR}/build |
cd ${BUILDDIR}/build |
172 |
fi |
fi |
173 |
} |
} |
174 |
|
|
175 |
|
cmake_mmake() |
176 |
|
{ |
177 |
|
if [[ ${MULTILIB_BUILD} = true ]] |
178 |
|
then |
179 |
|
mmake -C ${BUILDDIR}/build-$(mabi) "$@" || die |
180 |
|
else |
181 |
|
mmake -C ${BUILDDIR}/build "$@" || die |
182 |
|
fi |
183 |
|
} |
184 |
|
|
185 |
cmake_src_compile() |
cmake_src_compile() |
186 |
{ |
{ |
187 |
cd ${SRCDIR} |
cd ${SRCDIR} |
188 |
|
|
189 |
cmake_setup_builddir || die |
cmake_setup_builddir || die |
190 |
cmake_configure || die |
cmake_configure "$@" || die |
191 |
mmake || die |
cmake_mmake || die |
192 |
} |
} |
193 |
|
|
194 |
cmake_src_check() |
cmake_src_check() |
240 |
for abi in ${abis_to_run} |
for abi in ${abis_to_run} |
241 |
do |
do |
242 |
cd ${BUILDDIR}/build-${abi} |
cd ${BUILDDIR}/build-${abi} |
243 |
make ${MAKEOPTS} DESTDIR=${BINDIR} install || die |
abi-${abi} make ${MAKEOPTS} DESTDIR=${BINDIR} install || die |
244 |
|
|
245 |
cd ${SRCDIR}-${abi} |
cd ${SRCDIR}-${abi} |
246 |
local i |
local i |