【发布时间】:2020-07-18 22:36:09
【问题描述】:
我想在我的 cmake 项目中使用this library,但是它带有一个configure 文件而不是CMakeLists.txt
#! /bin/sh
# waf configure wrapper
# based on http://code.google.com/p/waf/source/browse/configure
CUR_DIR=$PWD
#possible relative path
WORKINGDIR=`dirname $0`
cd $WORKINGDIR
#abs path
WORKINGDIR=`pwd`
cd $CUR_DIR
WAF=$WORKINGDIR/tools/waf
# Generates a Makefile. Requires that $WAF is set.
#
generateMakefile()
{
cat > Makefile << EOF
#!/usr/bin/make -f
# Waf Makefile wrapper
WAF_HOME=$CUR_DIR
all:
@$WAF build
all-debug:
@$WAF -v build
all-progress:
@$WAF -p build
install:
$WAF install --yes;
uninstall:
$WAF uninstall
clean:
@$WAF clean
distclean:
@$WAF distclean
@-rm -rf build
@-rm -f Makefile
check:
@$WAF check
dist:
@$WAF dist
.PHONY: clean dist distclean check uninstall install all
EOF
}
generateMakefile
"${WAF}" configure $*
exit $?
是否有用于转换的自动化工具? CMake 是否支持使用配置文件?是否有转换的经验法则 - 即将 ... 替换为 add_library?
【问题讨论】:
标签: c++ makefile cmake configure