update method to find GmmLib

search order is:
1. check variable GMMUMD_LIB_NAME. if set target of this name should
exist
2. check for variable GMM_SOURCE_DIR. if set include such folder and
check GMMUMD_LIB_NAME for library name assumig 'gmm_umd' as default
3. check if gmmlib folder exists in workspace. if yes, then include it
and check GMMUMD_LIB_NAME for library name assuming 'gmm_umd' as default

Change-Id: I9f5f69ab97c0bb8f2c250ac91b69c3ccd048fdda
This commit is contained in:
Artur Harasimiuk 2018-02-23 20:47:53 +01:00 committed by sys_ocldev
parent 7255b17d6b
commit 2e5e1ac0fb
2 changed files with 28 additions and 15 deletions

View File

@ -189,6 +189,10 @@ if(ARTIFACTS_DIR)
list(APPEND IGDRCL__IGC_TARGETS "common_clang_dll")
# select proper gmm from artifacts
if(NOT GMMUMD_LIB_NAME)
set(GMMUMD_LIB_NAME "gmm_umd")
endif()
string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_lower)
if(NOT GMM_LIB_PATHS)
if(WIN32)
@ -218,20 +222,32 @@ if(ARTIFACTS_DIR)
)
set(IGDRCL__IGC_INCLUDE_DIR ${THIRD_PARTY_DIR})
else(ARTIFACTS_DIR)
if(GMM_SOURCE_DIR)
get_filename_component(GMM_SOURCE_DIR "${GMM_SOURCE_DIR}" ABSOLUTE)
else(GMM_SOURCE_DIR)
get_filename_component(GMM_SOURCE_DIR_tmp "${CMAKE_SOURCE_DIR}/../gmmlib" ABSOLUTE)
if(IS_DIRECTORY "${GMM_SOURCE_DIR_tmp}")
set(GMM_SOURCE_DIR "${GMM_SOURCE_DIR_tmp}")
# GmmLib detection
if(NOT GMMUMD_LIB_NAME)
if(TARGET gmm_umd)
set(GMMUMD_LIB_NAME "gmm_umd")
else()
if(GMM_SOURCE_DIR)
get_filename_component(GMM_SOURCE_DIR "${GMM_SOURCE_DIR}" ABSOLUTE)
else(GMM_SOURCE_DIR)
get_filename_component(GMM_SOURCE_DIR_tmp "${CMAKE_SOURCE_DIR}/../gmmlib" ABSOLUTE)
if(IS_DIRECTORY "${GMM_SOURCE_DIR_tmp}")
set(GMM_SOURCE_DIR "${GMM_SOURCE_DIR_tmp}")
endif()
endif()
if(NOT IS_DIRECTORY "${GMM_SOURCE_DIR}")
message(FATAL_ERROR "GmmLib not found!")
endif()
message(STATUS "GmmLib source dir is: ${GMM_SOURCE_DIR}")
add_subdirectory("${GMM_SOURCE_DIR}" "${IGDRCL_BUILD_DIR}/gmmlib")
if(NOT GMMUMD_LIB_NAME)
set(GMMUMD_LIB_NAME "gmm_umd")
endif()
endif()
endif()
if(NOT IS_DIRECTORY "${GMM_SOURCE_DIR}")
message(FATAL_ERROR "GmmLib source not found!")
endif()
message(STATUS "GmmLib source dir is: ${GMM_SOURCE_DIR}")
add_subdirectory("${GMM_SOURCE_DIR}" "${IGDRCL_BUILD_DIR}/gmmlib")
set(UMKM_SHAREDDATA_INCLUDE_PATHS $<TARGET_PROPERTY:gmm_umd,INTERFACE_INCLUDE_DIRECTORIES>)
set(UMKM_SHAREDDATA_INCLUDE_PATHS $<TARGET_PROPERTY:${GMMUMD_LIB_NAME},INTERFACE_INCLUDE_DIRECTORIES>)
if(IGC_DIR)
get_filename_component(IGC_DIR "${IGC_DIR}" ABSOLUTE)

View File

@ -302,9 +302,6 @@ target_compile_definitions(${NEO_STATIC_LIB_NAME} PUBLIC DEFAULT_PLATFORM=${DEFA
link_directories(${GMM_LIB_PATHS})
if(NOT GMMUMD_LIB_NAME)
set(GMMUMD_LIB_NAME "gmm_umd" CACHE STRING "name of gmm static library")
endif()
target_link_libraries(${NEO_STATIC_LIB_NAME} ${GMMUMD_LIB_NAME})
if(WIN32)