Skip to content

Commit

Permalink
Fix support for consuming YCM via FetchContent_MakeAvailable
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Nov 9, 2024
1 parent b1c62ba commit a7c53d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@


cmake_minimum_required(VERSION 3.16)
project(YCM VERSION 0.17.0 LANGUAGES NONE)
project(YCM VERSION 0.17.1 LANGUAGES NONE)

# Check if the project is the main project or included via FetchContent
if (NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
# Project is included via FetchContent
include(${CMAKE_CURRENT_SOURCE_DIR}/tools/UseYCMFromSource.cmake)
# Propagate relevant variables modified by UseYCMFromSource to who called add_subdirectory
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} PARENT_SCOPE)
set(__USEYCMFROMSOURCE_INCLUDED ${__USEYCMFROMSOURCE_INCLUDED} PARENT_SCOPE)
set(YCM_MODULE_DIR ${YCM_MODULE_DIR} PARENT_SCOPE)
return()
endif()

Expand Down

0 comments on commit a7c53d2

Please sign in to comment.