#NEWLINE# def write_dependencies_cmake( self , sdk_dirs , host_dirs = None ) : #NEWLINE# #INDENT# ' Write the dependencies.cmake file. This will be read by\n        qibuild-config.cmake to set CMAKE_PREFIX_PATH and\n        qibuild_DIR, so that just running `cmake ..` works\n\n        ' #NEWLINE# to_write = '\n#############################################\n#QIBUILD AUTOGENERATED FILE. DO NOT EDIT.\n#############################################\n\n# Add path to CMake framework path if necessary:\nset(_qibuild_path "{cmake_qibuild_dir}")\nlist(FIND CMAKE_MODULE_PATH "${{_qibuild_path}}" _found)\nif(_found STREQUAL "-1")\n  # Prefer cmake files matching  current qibuild installation\n  # over cmake files in the cross-toolchain\n  list(INSERT CMAKE_MODULE_PATH 0 "${{_qibuild_path}}")\nendif()\n\n# Dependencies:\n{dep_to_add}\n\n# Store CMAKE_MODULE_PATH and CMAKE_PREFIX_PATH in cache:\nset(CMAKE_MODULE_PATH ${{CMAKE_MODULE_PATH}} CACHE INTERNAL ""  FORCE)\nset(CMAKE_PREFIX_PATH ${{CMAKE_PREFIX_PATH}} CACHE INTERNAL ""  FORCE)\n\n{custom_cmake_code}\n' #NEWLINE# custom_cmake_code = '' #NEWLINE# if self . build_config . local_cmake : #NEWLINE# #INDENT# to_include = qisys . sh . to_posix_path ( self . build_config . local_cmake ) #NEWLINE# custom_cmake_code += ( 'include("%s")\n' % to_include ) #NEWLINE# #UNINDENT# cmake_qibuild_dir = qibuild . cmake . get_cmake_qibuild_dir ( ) #NEWLINE# cmake_qibuild_dir = qisys . sh . to_posix_path ( cmake_qibuild_dir ) #NEWLINE# dep_to_add = '' #NEWLINE# dirs_to_add = sdk_dirs #NEWLINE# if host_dirs : #NEWLINE# #INDENT# dirs_to_add = ( host_dirs + sdk_dirs ) #NEWLINE# #UNINDENT# for dir_to_add in dirs_to_add : #NEWLINE# #INDENT# dep_to_add += 'list(FIND CMAKE_PREFIX_PATH "{dir_to_add}" _found)\nif(_found STREQUAL "-1")\n  list(APPEND CMAKE_PREFIX_PATH "{dir_to_add}")\nendif()\n' . format ( dir_to_add = qisys . sh . to_posix_path ( dir_to_add ) ) #NEWLINE# #UNINDENT# to_write = to_write . format ( cmake_qibuild_dir = cmake_qibuild_dir , dep_to_add = dep_to_add , custom_cmake_code = custom_cmake_code ) #NEWLINE# qibuild_python = os . path . join ( qibuild . __file__ , '..' , '..' ) #NEWLINE# qibuild_python = os . path . abspath ( qibuild_python ) #NEWLINE# qibuild_python = qisys . sh . to_posix_path ( qibuild_python ) #NEWLINE# to_write += ( '\nset(QIBUILD_PYTHON_PATH "%s" CACHE STRING "" FORCE)\n' % qibuild_python ) #NEWLINE# qisys . sh . mkdir ( self . build_directory , recursive = True ) #NEWLINE# dep_cmake = os . path . join ( self . build_directory , 'dependencies.cmake' ) #NEWLINE# qisys . sh . write_file_if_different ( to_write , dep_cmake )