macro (find_getopt)
    if (MSVC)
        if(NOT GETOPT_LIB_DIR AND NOT GETOPT_INCLUDE_DIR)
            message (FATAL_ERROR "Missing 'GETOPT_LIB_DIR' and 'GETOPT_INCLUDE_DIR' options to CMake command. Aborting...")
        else(NOT GETOPT_LIB_DIR AND NOT GETOPT_INCLUDE_DIR)
            find_library(GETOPT getopt PATHS ${GETOPT_LIB_DIR})
            set(GETOPT_LIBS ${GETOPT})
            include_directories(${GETOPT_INCLUDE_DIR})
        endif(NOT GETOPT_LIB_DIR AND NOT GETOPT_INCLUDE_DIR)
    endif (MSVC)
endmacro ()