approvals / ApprovalTests.cpp

Native ApprovalTests for C++ on Linux, Mac and Windows
https://approvaltestscpp.readthedocs.io/en/latest/
Apache License 2.0
316 stars 51 forks source link

Don't create third_party targets if they have been created already #88

Closed claremacrae closed 4 years ago

claremacrae commented 4 years ago

I'm experimenting with creating super-builds that pull in my local clones of the third_party libraries that we support...

It would be helpful if our CMakeLists.txt files for the 3rd-party code skipped adding themselves if their real library had already been loaded.

For example:

if(NOT TARGET Catch2)
    project(boost.ut CXX)
    set(CMAKE_CXX_STANDARD 17)
    add_library(${PROJECT_NAME} INTERFACE)
    target_include_directories(${PROJECT_NAME}
            INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
... etc...
endif()