首页 > 其他分享 >QT + VS 创建OCC项目

QT + VS 创建OCC项目

时间:2022-10-27 15:00:08浏览次数:58  
标签:bat set QT lib OCC 7.3 VS DevEnvDir%

为了方便项目的移植,项目的设置最好采用vs的bat进行打开

1、env.bat

 

 OCC_PATH为自己的OCC的路径

env.bat

@echo off

set "OCC_PATH=D:\Program Files (x86)\OpenCASCADE-7.3.0-vc14-64\opencascade-7.3.0"

call "%OCC_PATH%\env.bat" %1 %2 %3

call "custom.bat" %1 %2 %3

set "RES_DIR=%~dp0win%ARCH%\%VCVER%\res"
set "CSF_ResourcesDefaults=%RES_DIR%"
set "CSF_TutorialResourcesDefaults=%RES_DIR%"

set "PATH=%QTDIR%/bin;%PATH%"

  msvc.bat

 

 其中dp0后面的OCCQT为当前项目的名称

msvc.bat

@echo off

Setlocal EnableDelayedExpansion

rem Setup environment
call "%~dp0env.bat" %1 %2 %3

rem Define path to project file
set "PRJFILE=%~dp0OCCQT.sln"

rem Launch Visual Studio - either professional (devenv) or Express, as available
if exist "%DevEnvDir%\devenv.exe"  (
  start "" "%DevEnvDir%\devenv.exe" "%PRJFILE%"
) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe"  (
  start "" "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
) else (
  echo Error: Could not find MS Visual Studio ^(%VCVER%^)
  echo Check relevant environment variable ^(e.g. VS100COMNTOOLS for vc10^)
)

  OCC_PropertySheet.props,属性管理器,添加这个后方便于以后相关项目的添加,里面添加的关于occ的设置

 

 OCC_PropertySheet.props

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets" />
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup />
  <ItemDefinitionGroup>
    <ClCompile>
      <AdditionalIncludeDirectories>$(CASROOT);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
    </ClCompile>
    <Link>
      <AdditionalLibraryDirectories>$(CSF_OCCTLibPath);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
      <AdditionalDependencies>TKBin.lib;TKBinL.lib;TKBinTObj.lib;TKBinXCAF.lib;TKBO.lib;TKBool.lib;TKBRep.lib;TKCAF.lib;TKCDF.lib;TKD3DHost.lib;TKDCAF.lib;TKDFBrowser.lib;TKDraw.lib;TKernel.lib;TKFeat.lib;TKFillet.lib;TKG2d.lib;TKG3d.lib;TKGeomAlgo.lib;TKGeomBase.lib;TKHLR.lib;TKIGES.lib;TKIVtk.lib;TKIVtkDraw.lib;TKLCAF.lib;TKMath.lib;TKMesh.lib;TKMeshVS.lib;TKOffset.lib;TKOpenGl.lib;TKPrim.lib;TKQADraw.lib;TKService.lib;TKShapeView.lib;TKShHealing.lib;TKStd.lib;TKStdL.lib;TKSTEP.lib;TKSTEP209.lib;TKSTEPAttr.lib;TKSTEPBase.lib;TKSTL.lib;TKTInspector.lib;TKTInspectorAPI.lib;TKTObj.lib;TKTObjDRAW.lib;TKToolsDraw.lib;TKTopAlgo.lib;TKTopTest.lib;TKTreeModel.lib;TKV3d.lib;TKVCAF.lib;TKView.lib;TKViewerTest.lib;TKVInspector.lib;TKVRML.lib;TKXCAF.lib;TKXDEDRAW.lib;TKXDEIGES.lib;TKXDESTEP.lib;TKXMesh.lib;TKXml.lib;TKXmlL.lib;TKXmlTObj.lib;TKXmlXCAF.lib;TKXSBase.lib;TKXSDRAW.lib;%(AdditionalDependencies)</AdditionalDependencies>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup />
</Project>

  其中依赖的lib可以在相应的occ的lib目录下,如(D:\Program Files (x86)\OpenCASCADE-7.3.0-vc14-64\opencascade-7.3.0\win64\vc14\lib),

通过一个命令dir /B > lib.txt生成

lib.bat

dir /B > lib.txt

  

标签:bat,set,QT,lib,OCC,7.3,VS,DevEnvDir%
From: https://www.cnblogs.com/unicornsir/p/16832259.html

相关文章

  • VS Code 配置JAVA环境
    1.首选添加如中文不好可先添加中文语言包,2.添加DebuggerforJava3.添加ExtensionPackForJava4。添加LanguageSupportfor Java至此,简单的学习环境已可以 ......
  • QT打开文件夹或文件,选择文件夹或者选择文件
    1.QProcess加explorer弹出打开文件夹1.1打开文件夹,并自动选中目标文件voidHisPicItem::SlotOpenTargetFile(QStringstrfile){QStringstrPicPath=strfile;......
  • vs code c++入门
    新建工程命令行创建vscode提供了命令行打开工作目录的功能mkdirplaygroundcdplaygroudcode.UI打开直接使用File->openFoldercommand模式使用F1快捷键可以打开......
  • linux LVS的DR模式多网段
    架构图:多网段:客户机位于192.168.10.x/24网段RS位于:10.0.0.x/24网段VIP:位于172.16.0.x/24网关通信过程:客户机(CIP)---->lvs(VIP)---->lvs(DIP)---->RS(RIP)-......
  • USB应用实战视频教程第3期:手把手玩转USB BULK方式下位机和QT6.4上位机开发(上篇)
    视频教程汇总帖:https://www.armbbs.cn/forum.php?mod=viewthread&tid=110519 为防止视频时间太长,本期视频先发布上篇USB下位机和USB驱动设计安装,以及以前基于emWin电脑......
  • Vscode自动生成文件注释和函数注释插件使用指南
    一、插件安装插件名:koroFileHeade插件安装二、插件配置打开配置文件添加配置//函数注释CTRL+ALT+T"fileheader.cursorMode":{"Fu......
  • Go——vscode调试环境
     Ctrl+Shift+P   go:install全选安装 launch.json文件{//UseIntelliSensetolearnaboutpossibleattributes.//Hovertoviewdescriptions......
  • linux LVS的DR模式实现
    架构图:环境:一台:客户端eth0:仅主机192.168.10.6/24GW:192.168.10.200一台:ROUTEReth0:NAT 10.0.0.200/24eth1:仅主机192.168.10.200/24启用IP_FORWARD一......
  • vscode编辑器配置
    目录一、配置二、插件三、插件批量迁移四、配置node语法提示五、参考一、配置1、打开默认配置文件ctrl+shift+p输入opendefaultsettings2、导出配置文件ctrl......
  • Git 在 vs code 正确提交推送代码
    1.写完相应的代码后,如图↓↓↓↓↓↓↓2.第一步,选中你要暂存的文件【暂存更改】如图↓↓↓↓↓↓提交后变成这样样子,如图↓↓↓↓↓↓↓3.第二步,填写本次提交文案(标......