From 1605accfed10e64a684362ba5d7d0c3b53689b38 Mon Sep 17 00:00:00 2001 From: Rodrigo Reichert Date: Tue, 1 Sep 2020 11:52:32 +1000 Subject: [PATCH] rodrigor/fix-inclusion of starling source directory over third party --- FindStarling.cmake | 1 - GenericFindDependency.cmake | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/FindStarling.cmake b/FindStarling.cmake index 9b07e99..a515497 100644 --- a/FindStarling.cmake +++ b/FindStarling.cmake @@ -12,6 +12,5 @@ GenericFindDependency( pvt-engine pvt-common starling-util - SOURCE_DIR starling SYSTEM_HEADER_FILE "pvt_driver/runner/pvt_runner.h" ) diff --git a/GenericFindDependency.cmake b/GenericFindDependency.cmake index f03f2f2..9945d7b 100644 --- a/GenericFindDependency.cmake +++ b/GenericFindDependency.cmake @@ -244,13 +244,17 @@ endmacro() # - x_SOURCE_SEARCH_PATHS - A list of paths to be searched for source code # macro(create_source_search_paths) + string(TOLOWER ${CMAKE_FIND_PACKAGE_NAME} lowercase_package_name) + # set defaults set(x_SOURCE_SEARCH_PATHS "") if(NOT x_SOURCE_DIR) list(APPEND x_SOURCE_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/${CMAKE_FIND_PACKAGE_NAME}") + list(APPEND x_SOURCE_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/${lowercase_package_name}") list(APPEND x_SOURCE_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/${x_TARGET}") list(APPEND x_SOURCE_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/lib${x_TARGET}") list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/third_party/${CMAKE_FIND_PACKAGE_NAME}") + list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/third_party/${lowercase_package_name}") list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/third_party/${x_TARGET}") list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/third_party/lib${x_TARGET}") else() @@ -259,9 +263,11 @@ macro(create_source_search_paths) list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/${x_SOURCE_DIR}") list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/third_party/${x_SOURCE_DIR}") list(APPEND x_SOURCE_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/${CMAKE_FIND_PACKAGE_NAME}/${x_SOURCE_DIR}") + list(APPEND x_SOURCE_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/${lowercase_package_name}/${x_SOURCE_DIR}") list(APPEND x_SOURCE_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/${x_TARGET}/${x_SOURCE_DIR}") list(APPEND x_SOURCE_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/lib${x_TARGET}/${x_SOURCE_DIR}") list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/third_party/${CMAKE_FIND_PACKAGE_NAME}/${x_SOURCE_DIR}") + list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/third_party/${lowercase_package_name}/${x_SOURCE_DIR}") list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/third_party/${x_TARGET}/${x_SOURCE_DIR}") list(APPEND x_SOURCE_SEARCH_PATHS "${PROJECT_SOURCE_DIR}/third_party/lib${x_TARGET}/${x_SOURCE_DIR}") endif()