Failed to build EMA C++ project

zheng
zheng LSEG
edited November 2024 in TREP APIs

According to the RTSDK C++ Installation Guide, cmake can be used to build the EMA C++ Package.

I installed CMake3.24.1 and Python3, but failed to achieve that. The CMakeOutput shows :

Call Stack (most recent call first):
D:/anaconda3/Library/lib/cmake/GTest/GTestConfig.cmake:32 (include)
CMake/rcdevEnvironment.cmake:125 (_find_package)
D:/Program Files/CMake/share/cmake-3.24/Modules/FindGTest.cmake:194 (find_package)
CMake/rcdevEnvironment.cmake:125 (_find_package)
CMake/addExternal_gtest.cmake:193 (find_package)
CMakeLists.txt:32 (include)

Any one knows what's the reason? Thanks!

Best Answer

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    Answer ✓

    @zheng

    Thank you for reaching out to us.

    I can run the cmake properly. I think the problem could relate to the gtest package. My log looks like this:

        -- Installing: C:/RTSDK222L1_VS2022/install/lib/gtestd.pdb
    -- Installing: C:/RTSDK222L1_VS2022/install/lib/gtest_maind.pdb
    -- Up-to-date: C:/RTSDK222L1_VS2022/install/lib/pkgconfig/gtest.pc
    -- Up-to-date: C:/RTSDK222L1_VS2022/install/lib/pkgconfig/gtest_main.pc
    Completed 'gtest'
    Building Custom Rule C:/RTSDK222L1_VS2022/external/BUILD/gtest/CMakeLists.txt
    CMake Warning (dev) at CMake/rcdevEnvironment.cmake:125 (_find_package):
    Policy CMP0144 is not set: find_package uses upper-case <PACKAGENAME>_ROOT
    variables. Run "cmake --help-policy CMP0144" for policy details. Use the
    cmake_policy command to set the policy and suppress this warning.

    CMake variable GTEST_ROOT is set to:

    C:/D_DRIVE/temp/RTSDK-2.2.2.L1.win.rrg/RTSDK-2.2.2.L1.win.rrg/installdb/WIN_64_VS143

    For compatibility, find_package is ignoring the variable, but code in a
    .cmake module might still use it.
    Call Stack (most recent call first):
    CMake/addExternal_gtest.cmake:193 (find_package)
    CMakeLists.txt:32 (include)
    This warning is for project developers. Use -Wno-dev to suppress it.

    -- Found GTest: C:/D_DRIVE/temp/RTSDK-2.2.2.L1.win.rrg/RTSDK-2.2.2.L1.win.rrg/installdb/WIN_64_VS143/lib/gtest.lib

    I am not sure why your cmake refers to the D:/anaconda3/Library/lib/cmake/GTest/GTestTargets.cmake.

    image.png

    Did you set the GTEST_ROOT environment variable? You may try to delete this environment variable.

Answers

  • Hi, @Jirapongse Thanks for your investigation and interpretation. It resolved the problem.

    Summary of the issue: i) My anaconda3 has two env, one is a virtual which is GTest and Git were installed. But the base(root) env should be the right choice; ii) env variable, just use default setting for anaconda3, which determined while installation; iii) I assume build path should be a sub-folder under the source directory(I'm not sure it's a decisive factor, but last several attemps were failed are not obey the rule).

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.