add option to exclude dependency check
authorSam Sortais <sam.sortais@xilinx.com>
Mon, 22 Aug 2016 17:37:36 +0000 (10:37 -0700)
committerWendy Liang <jliang@xilinx.com>
Thu, 13 Oct 2016 05:01:49 +0000 (22:01 -0700)
Add option to avoid checking for pre-existence of libmetal.a.
Add option to avoid checking external include existence.
This is needed in case cmake is invoked before those others are created.

Signed-off-by: Sam Sortais <sam.sortais@xilinx.com>
cmake/depends.cmake
cmake/options.cmake
lib/system/freertos/machine/zynq7/CMakeLists.txt
lib/system/freertos/machine/zynqmp_r5/CMakeLists.txt
lib/system/generic/machine/zynq7/CMakeLists.txt
lib/system/generic/machine/zynqmp_r5/CMakeLists.txt

index 477d90340bf52e1f8c524215c6b9d042cb081048..d5926ec59f12a3e6f35181ae94372093f5bb7063 100644 (file)
@@ -1,7 +1,9 @@
-find_package (Libmetal REQUIRED)
-collect (PROJECT_INC_DIRS "${LIBMETAL_INCLUDE_DIR}")
-collect (PROJECT_LIB_DIRS "${LIBMETAL_LIB_DIR}")
-collect (PROJECT_LIB_DEPS "${LIBMETAL_LIB}")
+if (WITH_LIBMETAL_FIND)
+  find_package (Libmetal REQUIRED)
+  collect (PROJECT_INC_DIRS "${LIBMETAL_INCLUDE_DIR}")
+  collect (PROJECT_LIB_DIRS "${LIBMETAL_LIB_DIR}")
+  collect (PROJECT_LIB_DEPS "${LIBMETAL_LIB}")
+endif (WITH_LIBMETAL_FIND)
 
 if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
   check_include_files (stdatomic.h HAVE_STDATOMIC_H)
index 358d8508bb1464929b2352e808007a983ab7cffb..0384ae2ccf0ec100ee22a044b294e7c80a6aacaa 100644 (file)
@@ -62,5 +62,8 @@ if ("${PROJECT_SYSTEM}" STREQUAL "linux")
   option (WITH_SHARED_LIB "Build with a shared library" ON)
 endif ("${PROJECT_SYSTEM}" STREQUAL "linux")
 
+option (WITH_LIBMETAL_FIND "Check Libmetal library can be found" ON)
+option (WITH_EXT_INCLUDES_FIND "Check other external includes are found" ON)
+
 message ("-- C_FLAGS : ${CMAKE_C_FLAGS}")
 # vim: expandtab:ts=2:sw=2:smartindent
index 19b24cafed0bfcf2f4ebe5f87b0188f059832e72..3e446594187322ad4ec8914760778ede9b3f89c0 100644 (file)
@@ -1,5 +1,7 @@
 
 #collect (PROJECT_LIB_SOURCES machine_system.c)
 
-find_path (LIBXIL_INCLUDE_DIR NAMES xparameters.h PATHS ${CMAKE_FIND_ROOT_PATH})
-collect (PROJECT_INC_DIRS ${LIBXIL_INCLUDE_DIR})
+if (WITH_EXT_INCLUDES_FIND)
+  find_path (LIBXIL_INCLUDE_DIR NAMES xparameters.h PATHS ${CMAKE_FIND_ROOT_PATH})
+  collect (PROJECT_INC_DIRS ${LIBXIL_INCLUDE_DIR})
+endif (WITH_EXT_INCLUDES_FIND)
index 9f9b6802eaf925bf2668d252ed31ee6022cd9fd8..47b839c268df823bac795c61687f12608a8ba3f5 100644 (file)
@@ -1,4 +1,6 @@
 
-# FIX ME: CMAKE_FIND_ROOT_PATH doesn't work
-find_path (LIBXIL_INCLUDE_DIR NAMES xparameters.h PATHS ${CMAKE_FIND_ROOT_PATH})
-collect (PROJECT_INC_DIRS ${LIBXIL_INCLUDE_DIR})
+if (WITH_EXT_INCLUDES_FIND)
+  # FIX ME: CMAKE_FIND_ROOT_PATH doesn't work
+  find_path (LIBXIL_INCLUDE_DIR NAMES xparameters.h PATHS ${CMAKE_FIND_ROOT_PATH})
+  collect (PROJECT_INC_DIRS ${LIBXIL_INCLUDE_DIR})
+endif (WITH_EXT_INCLUDES_FIND)
index 19b24cafed0bfcf2f4ebe5f87b0188f059832e72..7def18dc5fbcd11a73ffb62c9a3ac04cd2fb1fe4 100644 (file)
@@ -1,5 +1,8 @@
 
 #collect (PROJECT_LIB_SOURCES machine_system.c)
 
-find_path (LIBXIL_INCLUDE_DIR NAMES xparameters.h PATHS ${CMAKE_FIND_ROOT_PATH})
-collect (PROJECT_INC_DIRS ${LIBXIL_INCLUDE_DIR})
+if (WITH_EXT_INCLUDES_FIND)
+  find_path (LIBXIL_INCLUDE_DIR NAMES xparameters.h PATHS ${CMAKE_FIND_ROOT_PATH})
+  collect (PROJECT_INC_DIRS ${LIBXIL_INCLUDE_DIR})
+endif (WITH_EXT_INCLUDES_FIND)
+
index 9f9b6802eaf925bf2668d252ed31ee6022cd9fd8..0a7a951dc365e6aaddb751056b03c93c868d5ab6 100644 (file)
@@ -1,4 +1,7 @@
 
 # FIX ME: CMAKE_FIND_ROOT_PATH doesn't work
-find_path (LIBXIL_INCLUDE_DIR NAMES xparameters.h PATHS ${CMAKE_FIND_ROOT_PATH})
-collect (PROJECT_INC_DIRS ${LIBXIL_INCLUDE_DIR})
+
+if (WITH_EXT_INCLUDES_FIND)
+  find_path (LIBXIL_INCLUDE_DIR NAMES xparameters.h PATHS ${CMAKE_FIND_ROOT_PATH})
+  collect (PROJECT_INC_DIRS ${LIBXIL_INCLUDE_DIR})
+endif (WITH_EXT_INCLUDES_FIND)