[CMake] Built-in way to detect if a root script is standalone or not?

Robert Dailey rcdailey.lists at gmail.com
Mon Jul 17 10:58:57 EDT 2017


I have logic similar to this in some of my middleware libraries' root
CMakeLists.txt:

if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
    set( STANDALONE TRUE )
endif()

Is there a built-in way to detect this?


More information about the CMake mailing list