myx-cmake-example-features/cmake/myx/backports/TopLevelProject.cmake
2023-02-17 14:36:44 +03:00

10 lines
243 B
CMake

include_guard(GLOBAL)
if(${CMAKE_VERSION} VERSION_LESS 3.21)
get_property(__parent_directory DIRECTORY PROPERTY PARENT_DIRECTORY)
if(NOT __parent_directory)
set(PROJECT_IS_TOP_LEVEL true)
endif()
unset(__parent_directory)
endif()