3

关于这个主题,我所能找到的只是工具包网站上的一个论坛帖子,说明我需要SET_TARGET_PROPERTIES在我设置VS_SCCPROJECTNAME,VS_SCCLOCALPATHVS_SCCPROVIDER属性的 CMakeLists 文件中添加一个调用。我尝试了以下代码段,但插件仍然没有提示我打开解决方案,也没有自动签出我编辑的文件。非常感谢您的帮助!

IF (WIN32)
    SET_TARGET_PROPERTIES (${MY_PROJECT_NAME} PROPERTIES
        VS_SCCPROJECTNAME "Perforce Project"
        VS_SCCLOCALPATH ${THE_ROOT_DIRECTORY_OF_MY_PERFORCE_WORKSPACE_ON_MY_DRIVE}
        VS_SCCPROVIDER "MSSCCI:Perforce SCM"
    )
ENDIF (WIN32)

作为旁注,我在资源管理器中的上下文菜单也没有在 perforce 菜单组下给我“签出”选项。也许这些问题是相关的?

4

1 回答 1

4

Oops, missed the underscores in the VS_SCC values. It should have read

IF (WIN32)
    SET_TARGET_PROPERTIES (${MY_PROJECT_NAME} PROPERTIES
        VS_SCC_PROJECTNAME "Perforce Project"
        VS_SCC_LOCALPATH ${THE_ROOT_DIRECTORY_OF_MY_PERFORCE_WORKSPACE_ON_MY_DRIVE}
        VS_SCC_PROVIDER "MSSCCI:Perforce SCM"
    )
ENDIF (WIN32)

I cleaned my cmake directory and regenerated and now it works

于 2012-05-26T00:10:24.203 回答