[nncc-cmake] Change nncc variable name used in modules (#7662)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 23 Sep 2019 00:49:35 +0000 (09:49 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 23 Sep 2019 00:49:35 +0000 (09:49 +0900)
Introduce NNAS_PROJECT_SOURCE_DIR and NNAS_EXTERNALS_DIR to alternate NNCC_XXX variable
Use workaround for NNAS_EXTERNALS_DIR - CI issue

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
infra/cmake/modules/ExternalSourceTools.cmake
infra/cmake/modules/ThirdPartyTools.cmake
infra/nncc/CMakeLists.txt

index 753f7ca..87cb152 100644 (file)
@@ -25,7 +25,7 @@ function(ExternalSource_Download PREFIX)
 
   get_filename_component(FILENAME ${URL} NAME)
 
-  set(CACHE_DIR "${NNCC_EXTERNALS_DIR}")
+  set(CACHE_DIR "${NNAS_EXTERNALS_DIR}")
   set(OUT_DIR "${CACHE_DIR}/${DIRNAME}")
   set(TMP_DIR "${CACHE_DIR}/${DIRNAME}-tmp")
 
index 8fbeacf..df3c30b 100644 (file)
@@ -15,7 +15,7 @@ function(ThirdParty_URL VARNAME)
     message(FATAL_ERROR "VERSION is missing")
   endif(NOT ARG_VERSION)
 
-  set(PACKAGE_INFO_DIR "${NNCC_PROJECT_SOURCE_DIR}/infra/nncc/3rdparty/${ARG_PACKAGE}/${ARG_VERSION}")
+  set(PACKAGE_INFO_DIR "${NNAS_PROJECT_SOURCE_DIR}/infra/nncc/3rdparty/${ARG_PACKAGE}/${ARG_VERSION}")
   set(PACKAGE_URL_FILE "${PACKAGE_INFO_DIR}/URL.default")
   set(PACKAGE_URL_LOCAL_FILE "${PACKAGE_INFO_DIR}/URL.local")
 
index ab86384..fc96c88 100644 (file)
@@ -13,27 +13,30 @@ set(CMAKE_CXX_STANDARD 11)
 #       such as `cmake-server`.
 set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
 
-set(NNCC_PROJECT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." CACHE
-  INTERNAL "Where to find nncc top-level source directory"
+set(NNAS_PROJECT_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." CACHE
+  INTERNAL "Where to find nnas top-level source directory"
 )
 
 set(NNCC_EXTERNALS_DIR
-  "${NNCC_PROJECT_SOURCE_DIR}/externals" CACHE
+  "${NNAS_PROJECT_SOURCE_DIR}/externals" CACHE
   INTERNAL "Where to download external dependencies"
 )
 set(NNCC_OVERLAY_DIR "${CMAKE_BINARY_DIR}/overlay" CACHE
     INTERNAL "Where locally built external dependencies are installed")
+# TODO Remove NNCC_EXTERNALS_DIR
+set(NNAS_EXTERNALS_DIR ${NNCC_EXTERNALS_DIR} CACHE
+  INTERNAL "Where to download external dependencies")
 
 # This allows find_package to access configurations installed inside overlay
 list(APPEND CMAKE_PREFIX_PATH "${NNCC_OVERLAY_DIR}")
 
 macro(nnas_include PREFIX)
-  include("${NNCC_PROJECT_SOURCE_DIR}/infra/cmake/modules/${PREFIX}.cmake")
+  include("${NNAS_PROJECT_SOURCE_DIR}/infra/cmake/modules/${PREFIX}.cmake")
 endmacro(nnas_include)
 
 macro(nncc_find_package PREFIX)
   find_package(${PREFIX} CONFIG NO_DEFAULT_PATH
-    PATHS ${NNCC_PROJECT_SOURCE_DIR}/infra/nncc/cmake/packages
+    PATHS ${NNAS_PROJECT_SOURCE_DIR}/infra/nncc/cmake/packages
     ${ARGN}
   )
 endmacro(nncc_find_package)
@@ -45,7 +48,7 @@ endmacro(nncc_find_package)
 #
 # TODO Explain how to add a resource in README.md
 function(nncc_find_resource NAME)
-  set(RESOURCE_DIR "${NNCC_PROJECT_SOURCE_DIR}/res/${NAME}")
+  set(RESOURCE_DIR "${NNAS_PROJECT_SOURCE_DIR}/res/${NAME}")
 
   if(NOT IS_DIRECTORY ${RESOURCE_DIR})
     set(${NAME}_FOUND FALSE PARENT_SCOPE)
@@ -140,5 +143,5 @@ nnas_include(AddSubdirectories)
 ### Components
 ###
 if(ENABLE_CONTRIB_BUILD)
-  add_subdirectory("${NNCC_PROJECT_SOURCE_DIR}/compiler" "${CMAKE_BINARY_DIR}/compiler")
+  add_subdirectory("${NNAS_PROJECT_SOURCE_DIR}/compiler" "${CMAKE_BINARY_DIR}/compiler")
 endif(ENABLE_CONTRIB_BUILD)