CMakeLists.txt文件写法(11):让编译者在界面上设置你提供的选项

例如

#增加一个选项,WXWINDOWS_USE_SHARED_LIBS
    OPTION(WXWINDOWS_USE_SHARED_LIBS "Use shared versions (.so) of wxWindows libraries" ON)
    MARK_AS_ADVANCED(WXWINDOWS_USE_SHARED_LIBS) 

 

相关知识

 

  • OPTION: Provides an option that the user can optionally select.
      OPTION(OPTION_VAR "help string describing option"
    [initial value])

    Provide an option for the user to select as ON or OFF. If no initial value is provided, OFF is used.

     

    MARK_AS_ADVANCED: Mark cmake cached variables as advanced.

      MARK_AS_ADVANCED([CLEAR|FORCE] VAR VAR2 VAR...)

    Mark the named cached variables as advanced. An advanced variable will not be displayed in any of the cmake GUIs unless the show advanced option is on. If CLEAR is the first argument advanced variables are changed back to unadvanced. If FORCE is the first argument, then the variable is made advanced. If neither FORCE nor CLEAR is specified, new values will be marked as advanced, but if the variable already has an advanced/non-advanced state, it will not be changed

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值