[GNC-dev] Unable to run test on mac os.

John Ralls jralls at ceridwen.us
Sun Mar 22 18:25:45 EDT 2020



> On Mar 22, 2020, at 2:48 PM, jean <ripngo at gmail.com> wrote:
> 
> clang: error: no such file or directory: '/Users/Shari/gnucash-stable/build_xcode/common/test-core/libgtest.a'
> clang: error: no such file or directory: '/Users/Shari/gnucash-stable/build_xcode/common/test-core/libgtest.a'
> 
> The missing .a files are here:
> ./common/test-core/Debug/libgtest.a
> 
> I.e. xcode expects common/test-core/libgtest.a but instead I have ./common/test-core/Debug/libgtest.a

That's because Xcode lets you select the build type from the GUI and of course Cmake doesn't know about that at configure time so it can't adjust the locations. I'm actually a bit surprised that this is the only thing that broke.

This stackoverflow seems to address the problem: https://stackoverflow.com/questions/18393813/how-do-i-suppress-xcode-from-generating-a-folder-named-after-the-build-configura

Since it's just ligbtest maybe just tweaking that one target will work. Try adding to common/test-core/CMakeLists.txt at line 80

    if (CMAKE_GENERATOR STREQUAL Xcode)
       set_target_properties(gtest PROPERTIES
                             ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}
                             ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}
                             )
    endif()

and re-run cmake.

Regards,
John Ralls



More information about the gnucash-devel mailing list