myx/MyxCMake/backports/TopLevelProject.cmake

12 lines
288 B
CMake
Raw Normal View History

2022-09-28 22:48:13 +00:00
include_guard(GLOBAL)
2022-10-05 07:01:02 +00:00
if(${CMAKE_VERSION} VERSION_LESS 3.21)
2022-10-23 16:38:59 +00:00
get_property(__parent_directory DIRECTORY PROPERTY PARENT_DIRECTORY)
if(NOT __parent_directory)
set(PROJECT_IS_TOP_LEVEL TRUE)
else()
set(PROJECT_IS_TOP_LEVEL FALSE)
2022-09-28 22:48:13 +00:00
endif()
2022-10-23 16:38:59 +00:00
unset(__parent_directory)
2022-09-28 22:48:13 +00:00
endif()