解决错误Unknown CMake command "QT4_WRAP_CPP"(CMAKE对应Qt在Linux/Windows兼容问题)


错误:

CMake Error at src/Ui/CMakeLists.txt:15 (FIND_PACKAGE):
  Could not find module FindQT4.cmake or a configuration file for package
  QT4.

  Adjust CMAKE_MODULE_PATH to find FindQT4.cmake or set QT4_DIR to the
  directory containing a CMake configuration file for QT4.  The file will
  have one of the following names:

    QT4Config.cmake
    qt4-config.cmake



CMake Error at src/Ui/CMakeLists.txt:17 (INCLUDE):
  include called with wrong number of arguments.  Include only takes one
  file.


-- Directory /root/workspace/CenDVC/src/Ui
CMake Error at src/Ui/CMakeLists.txt:40 (QT4_WRAP_CPP):
  Unknown CMake command "QT4_WRAP_CPP".


-- Configuring incomplete, errors occurred!

或者类似。反正差不多。


情景:

        WINDOWS下的Qt工程,使用cmake构建无误,移植Linux时的错误。如题,然后修改如下解决:

FIND_PACKAGE (Qt4)

#FIND_PACKAGE (QT4 REQUIRED)


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值