myx-cmake-example-features/cmake/myx/backports/TopLevelProject.cmake

10 lines
243 B
CMake
Raw Permalink Normal View History

2022-10-06 12:22:57 +00:00
include_guard(GLOBAL)
if(${CMAKE_VERSION} VERSION_LESS 3.21)
2023-02-17 11:36:44 +00:00
get_property(__parent_directory DIRECTORY PROPERTY PARENT_DIRECTORY)
if(NOT __parent_directory)
2022-10-06 12:22:57 +00:00
set(PROJECT_IS_TOP_LEVEL true)
endif()
2023-02-17 11:36:44 +00:00
unset(__parent_directory)
2022-10-06 12:22:57 +00:00
endif()