cmake_modules/CheckHaskellPackageExists.cmake
changeset 15700 a3d2f69f3ac1
parent 13291 31615a2e0db1
equal deleted inserted replaced
15699:27eb5abd5058 15700:a3d2f69f3ac1
     9 # This software is distributed WITHOUT ANY WARRANTY; without even the
     9 # This software is distributed WITHOUT ANY WARRANTY; without even the
    10 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    10 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    11 # See the License for more information.
    11 # See the License for more information.
    12 #=============================================================================
    12 #=============================================================================
    13 
    13 
    14 macro(CHECK_HASKELL_PACKAGE_EXISTS PACKAGE MODULE FUNCTION PARAMCOUNT)
    14 macro(CHECK_HASKELL_PACKAGE_EXISTS PACKAGE MODULE FUNCTION PARAMCOUNT REQUIRED)
    15 # NOTE: MODULE, FUNCTION and PARAMCOUNT are curretly ignored.
    15 # NOTE: MODULE, FUNCTION and PARAMCOUNT are curretly ignored.
    16 # TODO: Either implement these or drop?
    16 # TODO: Either implement these or drop?
    17 
    17 
    18   set(VARIABLE "HS_PACKAGE_${PACKAGE}")
    18   set(VARIABLE "HS_PACKAGE_${PACKAGE}")
    19   if(NOT (${VARIABLE} EQUAL "1"))
    19   if(NOT (${VARIABLE} EQUAL "1"))
    39       set(${VARIABLE} "0" CACHE INTERNAL "Have package ${PACKAGE}")
    39       set(${VARIABLE} "0" CACHE INTERNAL "Have package ${PACKAGE}")
    40       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
    40       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
    41         "Determining if the Haskell package ${PACKAGE} "
    41         "Determining if the Haskell package ${PACKAGE} "
    42         "exists failed with the following output:\n"
    42         "exists failed with the following output:\n"
    43         "${BUILD_ERROR}\n\n")
    43         "${BUILD_ERROR}\n\n")
    44       message(FATAL_ERROR "Haskell package '${PACKAGE}' required")
    44       if("${REQUIRED}" STREQUAL "REQUIRED")
       
    45         message(FATAL_ERROR "Haskell package '${PACKAGE}' required")
       
    46       else()
       
    47         message(STATUS "Haskell package '${PACKAGE}' optionally required, but not found")
       
    48       endif()
    45     endif()
    49     endif()
    46   endif()
    50   endif()
    47 endmacro()
    51 endmacro()