cmake_modules/utils.cmake
branchwebgl
changeset 9521 8054d9d775fd
parent 9339 14f5f3a1e2f7
equal deleted inserted replaced
9282:92af50454cf2 9521:8054d9d775fd
    10 
    10 
    11 macro(find_package_or_disable _PKG_NAME _VAR_NAME)
    11 macro(find_package_or_disable _PKG_NAME _VAR_NAME)
    12     find_package(${_PKG_NAME})
    12     find_package(${_PKG_NAME})
    13     string(TOUPPER ${_PKG_NAME} _PKG_NAME_UP)
    13     string(TOUPPER ${_PKG_NAME} _PKG_NAME_UP)
    14     if(NOT ${_PKG_NAME_UP}_FOUND)
    14     if(NOT ${_PKG_NAME_UP}_FOUND)
    15         message(SEND_ERROR "Missing ${_PKG_NAME}! Rerun cmake with -D${_VAR_NAME}=1 to build without it.")
    15         message(SEND_ERROR "Missing ${_PKG_NAME}! Rerun cmake with -D${_VAR_NAME}=1 to skip this error.")
    16     endif(NOT ${_PKG_NAME_UP}_FOUND)
    16     endif(NOT ${_PKG_NAME_UP}_FOUND)
    17 endmacro(find_package_or_disable _PKG_NAME _VAR_NAME)
    17 endmacro(find_package_or_disable _PKG_NAME _VAR_NAME)
    18 
    18 
    19 macro(find_package_or_disable_msg _PKG_NAME _VAR_NAME _MSG)
    19 macro(find_package_or_disable_msg _PKG_NAME _VAR_NAME _MSG)
    20     if(NOT ${_VAR_NAME})
    20     if(NOT ${_VAR_NAME})
    35     set(${_VAR_NAME} "${_FLAG} ${${_VAR_NAME}}")
    35     set(${_VAR_NAME} "${_FLAG} ${${_VAR_NAME}}")
    36 endmacro(add_flag_prepend _VAR_NAME _FLAG)
    36 endmacro(add_flag_prepend _VAR_NAME _FLAG)
    37 
    37 
    38 macro(add_linker_flag _FLAG)
    38 macro(add_linker_flag _FLAG)
    39     list(APPEND haskell_flags "-optl" "-Wl,${_FLAG}")
    39     list(APPEND haskell_flags "-optl" "-Wl,${_FLAG}")
    40     add_flag_append(CMAKE_Pascal_FLAGS "-k${_FLAG}")
    40     #executables
    41     add_flag_append(CMAKE_EXE_LINKER_FLAGS "-Wl,${_FLAG}")
    41     add_flag_append(CMAKE_C_LINK_FLAGS "-Wl,${_FLAG}")
       
    42     add_flag_append(CMAKE_CXX_LINK_FLAGS "-Wl,${_FLAG}")
       
    43     add_flag_append(CMAKE_Pascal_LINK_FLAGS "-k${_FLAG}")
       
    44     #libraries
    42     add_flag_append(CMAKE_SHARED_LIBRARY_C_FLAGS "-Wl,${_FLAG}")
    45     add_flag_append(CMAKE_SHARED_LIBRARY_C_FLAGS "-Wl,${_FLAG}")
    43     add_flag_append(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Wl,${_FLAG}")
    46     add_flag_append(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Wl,${_FLAG}")
       
    47     #CMAKE_SHARED_LIBRARY_Pascal_FLAGS is already set by CMAKE_Pascal_LINK_FLAGS
    44 endmacro(add_linker_flag _FLAG)
    48 endmacro(add_linker_flag _FLAG)
    45 
    49 
    46 #TODO: find_package_or_bundle
    50 #TODO: find_package_or_bundle
    47 
    51 
    48 
    52