Warning, /system/qtcurve/cmake/CMakeCMacros.cmake is written in an unsupported language. File is not indexed.

0001 # Copyright (C) 2013~2014 by Yichao Yu
0002 # yyc1992@gmail.com
0003 #
0004 # Redistribution and use in source and binary forms, with or without
0005 # modification, are permitted provided that the following conditions
0006 # are met:
0007 #
0008 # 1. Redistributions of source code must retain the above copyright
0009 #    notice, this list of conditions and the following disclaimer.
0010 # 2. Redistributions in binary form must reproduce the above copyright
0011 #    notice, this list of conditions and the following disclaimer in the
0012 #    documentation and/or other materials provided with the distribution.
0013 #
0014 # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
0015 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
0016 # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
0017 # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
0018 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
0019 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0020 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0021 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0022 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
0023 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0024 
0025 # Public functions and macros provided by this file
0026 # (See comment of each for more detail):
0027 #     cmake_c_get_fix_include
0028 #     cmake_c_fix_include_path
0029 #     cmake_c_include_fix_path
0030 #     cmake_c_add_flags
0031 
0032 include(CMakeBaseMacros)
0033 include(CMakeStringMacros)
0034 include(CMakeHelperMacros)
0035 
0036 function(__cmake_c_macro_init)
0037   cmake_utils_get_global(CMAKE_GENERAL_BASE base_dir)
0038   cmake_utils_set_and_make_dir("${base_dir}/cmake_c_macros"
0039     CMAKE_C_UTILS_BASE c_base_dir)
0040   cmake_helper_clear_cache("${c_base_dir}")
0041   cmake_utils_set_and_make_dir("${c_base_dir}/include_fix"
0042     CMAKE_C_UTILS_INCLUDE_FIX_PREFIX c_include_fix)
0043   cmake_helper_reg(cmake_c_utils cmake-c-utils-helper.sh
0044     cmake_c_helper_command CMAKE_C_UTILS_BASE "${c_base_dir}"
0045     CMAKE_C_UTILS_INCLUDE_FIX_PREFIX "${c_include_fix}")
0046   cmake_utils_set_global(_CMAKE_C_UTILS_HELPER_COMMAND
0047     "${cmake_c_helper_command}")
0048 endfunction()
0049 cmake_utils_call_once(__cmake_c_macro_init)
0050 
0051 function(cmake_c_get_fix_include var)
0052   cmake_utils_get_global(CMAKE_C_UTILS_INCLUDE_FIX_PREFIX c_include_fix)
0053   set(name)
0054   if(ARGC GREATER 1)
0055     set(name "${ARGV1}")
0056   endif()
0057   set(dir "${c_include_fix}${name}")
0058   file(MAKE_DIRECTORY "${dir}")
0059   set("${var}" "${dir}" PARENT_SCOPE)
0060 endfunction()
0061 
0062 function(cmake_c_fix_include_path src tgt)
0063   set(name)
0064   if(ARGC GREATER 2)
0065     set(name "${ARGV2}")
0066   endif()
0067   cmake_utils_to_abs(src)
0068   cmake_c_get_fix_include(fix_path "${name}")
0069   cmake_helper_wrap_helper(cmake_c_utils command --fix-include
0070     "${src}" "${tgt}" "${fix_path}")
0071   execute_process(COMMAND "${command}")
0072 endfunction()
0073 
0074 function(cmake_c_include_fix_path)
0075   set(name)
0076   if(ARGC GREATER 0)
0077     set(name "${ARGV0}")
0078   endif()
0079   cmake_c_get_fix_include(fix_path "${name}")
0080   include_directories("${fix_path}")
0081 endfunction()
0082 
0083 macro(__cmake_c_add_flags_foreach)
0084   cmake_str_quote_shell("${new_flag}" new_flag)
0085   set(new_flags "${new_flags} ${new_flag}")
0086 endmacro()
0087 
0088 function(cmake_c_add_flags var)
0089   set(old_flags "${${var}}")
0090   set(new_flags "")
0091   cmake_array_foreach(new_flag __cmake_c_add_flags_foreach 1)
0092   set("${var}" "${old_flags} ${new_flags}" PARENT_SCOPE)
0093 endfunction()