MACRO (MYPACKAGEREPAIR)
  #
  # We always create a __fixme__.cmake
  #
  IF (NOT FIXME_CMAKE_SINGLETON)
    GET_PROPERTY(source_dir GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR)
    MESSAGE(STATUS "Generating a __fixme__.cmake")
    SET (FIXME_CMAKE "__fixme__.cmake")
    GET_FILENAME_COMPONENT(FIXME_CMAKE_ABSOLUTE ${FIXME_CMAKE} ABSOLUTE)
    FILE(WRITE ${FIXME_CMAKE} "# CMake settings to be propagated whenever you want - typically used for ExternalProject_Add\n")
    MARK_AS_ADVANCED (FIXME_CMAKE_ABSOLUTE)
    SET (FIXME_CMAKE_SINGLETON TRUE CACHE BOOL "__fixme__.cmake singleton")
    MARK_AS_ADVANCED (FIXME_CMAKE_SINGLETON)
  ENDIF ()
  IF (NOT HAVE_STDINT_H)
    GET_PROPERTY(source_dir_set GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR SET)
    IF (NOT ${source_dir_set})
      MESSAGE (WARNING "Cannot repair anything if any, property MYPACKAGE_SOURCE_DIR is not set")
    ELSE ()
      IF (NOT STDINT_H_SINGLETON)
        GET_PROPERTY(source_dir GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR)
        MESSAGE(STATUS "Generating a minimal stdint.h")
        SET(MYPACKAGE_GENERATED_INCLUDE_DIR "__generated_include_dir__")
        FILE(MAKE_DIRECTORY ${MYPACKAGE_GENERATED_INCLUDE_DIR})
        CONFIGURE_FILE(${source_dir}/stdint.h.in ${MYPACKAGE_GENERATED_INCLUDE_DIR}/stdint.h)
        GET_FILENAME_COMPONENT(_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE ${MYPACKAGE_GENERATED_INCLUDE_DIR} ABSOLUTE)
        INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})
        MESSAGE(STATUS "Appending in ${FIXME_CMAKE}: INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})")
        FILE(APPEND ${FIXME_CMAKE} "MESSAGE(STATUS \"Append to INCLUDE_DIRECTORIES: ${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE}\")\n")
        FILE(APPEND ${FIXME_CMAKE} "INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})\n")
      ENDIF ()
      SET (STDINT_H_SINGLETON TRUE CACHE BOOL "C stdint.h repair singleton")
      MARK_AS_ADVANCED (STDINT_H_SINGLETON)
    ENDIF ()
  ENDIF ()
ENDMACRO()
